From d55961995cd5163eff7c51b7f4b862631f246a0c Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 31 Mar 2024 15:41:02 +0200 Subject: [PATCH] docker: change the work directory to /var/www --- docker/common-setup.sh | 20 ++++++++++---------- docker/nginx/leftypol.conf | 4 ++-- docker/php/Dockerfile | 9 ++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/docker/common-setup.sh b/docker/common-setup.sh index 649a3049..e8e8ed2e 100755 --- a/docker/common-setup.sh +++ b/docker/common-setup.sh @@ -2,7 +2,7 @@ set -eu -install -m 775 -o leftypol -g leftypol -d /var/www-leftypol +install -m 775 -o leftypol -g leftypol -d /var/www ln -s \ /code/banners/ \ /code/static/ \ @@ -14,18 +14,18 @@ ln -s \ /code/LICENSE.* \ /code/robots.txt \ /code/install.sql \ - /var/www-leftypol/ + /var/www/ install -m 775 -o leftypol -g leftypol -d /var/tmp/leftypol install -m 775 -o leftypol -g leftypol -d /var/tmp/leftypol/cache -ln -s /var/tmp/leftypol /var/www-leftypol/tmp +ln -s /var/tmp/leftypol /var/www/tmp -install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/js -ln -s /code/js/* /var/www-leftypol/js/ +install -m 775 -o leftypol -g leftypol -d /var/www/js +ln -s /code/js/* /var/www/js/ -install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/templates -install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/templates/cache -ln -s /code/templates/* /var/www-leftypol/templates/ +install -m 775 -o leftypol -g leftypol -d /var/www/templates +install -m 775 -o leftypol -g leftypol -d /var/www/templates/cache +ln -s /code/templates/* /var/www/templates/ -install -m 775 -o leftypol -g leftypol -d /var/www-leftypol/inc -ln -s /code/inc/* /var/www-leftypol/inc/ +install -m 775 -o leftypol -g leftypol -d /var/www/inc +ln -s /code/inc/* /var/www/inc/ diff --git a/docker/nginx/leftypol.conf b/docker/nginx/leftypol.conf index ad421a9f..527873c5 100644 --- a/docker/nginx/leftypol.conf +++ b/docker/nginx/leftypol.conf @@ -6,7 +6,7 @@ server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name leftypol; - root /var/www-leftypol; + root /var/www; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; @@ -56,7 +56,7 @@ server { proxy_set_header Forwarded-Request-Id $x_request_id; fastcgi_pass php-upstream; fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name; fastcgi_read_timeout 600; include fastcgi_params; } diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index f70a05b9..bbae84fd 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -40,11 +40,10 @@ COPY --from=composer /usr/bin/composer /usr/bin/composer COPY . /code RUN /code/docker/common-setup.sh \ - && ln -s /code/composer.json /code/composer.lock /var/www-leftypol/ \ - && cd /var/www-leftypol && composer install + && ln -s /code/composer.json /code/composer.lock /var/www/ \ + && cd /var/www && composer install - -RUN /code/docker/common-setup.sh -WORKDIR "/var/www-leftypol" +# RUN /code/docker/common-setup.sh php +WORKDIR "/var/www" CMD ["php-fpm"] EXPOSE 9000