Вот мой файл Docker.
Код: Выделить всё
FROM ubuntu:22.04
RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update
RUN env TZ=Asia/Kolkata
# Set the timezone for PHP
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt install php7.0 -y
RUN apt install php7.0-mysql php7.0-mbstring \
php7.0-redis php7.0-curl php7.0-xsl php7.0-xml \
php7.0-xmlwriter php7.0-mongodb php7.0-mcrypt -y
RUN apt install apache2 curl -y
WORKDIR /var/www/html
RUN curl -s -X GET "http://3.109.84.217:7998/signedurl/get" -F 'key=env.json' | xargs curl -s -o env.json -L
RUN apt install jq -y
# Install Composer 2.2
RUN curl -sS https://getcomposer.org/installer | php -- --version=2.2.0 \
&& mv composer.phar /usr/local/bin/composer
# RUN cat env.json | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' > .env
# RUN rm -rf env.json
COPY . /var/www/html
RUN chmod -R 777 /var/www/html
# RUN service apache2 start
CMD ["apache2ctl", "-D", "FOREGROUND"]
EXPOSE 80

Как видите, в корне каталога находится файл test.php.
Вот и делаю.
Код: Выделить всё
Код: Выделить всё
string(14) "testing docker"
string(24) "/var/www/html/dotEnv.php".
Код: Выделить всё
var_dump("testing docker");
var_dump(realpath( __DIR__ . "../common/token/rediscache.php"));
Код: Выделить всё
string(14) "testing docker"
bool(false).
Пожалуйста, помогите мне решить эту проблему, любая помощь приветствуется.
Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/791 ... -container
Мобильная версия