docker: change work directory to /var/www

This commit is contained in:
Zankaria 2024-03-31 15:41:02 +02:00 committed by Zankaria
parent 20b7ed7829
commit 726de817b1
4 changed files with 44 additions and 15 deletions

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM php:8.1.8-fpm
COPY . /code
RUN docker-php-ext-install pdo pdo_mysql
RUN apt-get update -y && apt-get install -y libpng-dev libjpeg-dev libonig-dev
RUN docker-php-ext-install mbstring
RUN apt-get update -y && apt-get install -y libmcrypt-dev
# RUN docker-php-ext-install -j$(nproc) mcrypt
RUN docker-php-ext-install iconv
RUN apt-get update -y && apt-get install -y imagemagick
RUN apt-get update -y && apt-get install -y graphicsmagick
RUN apt-get update -y && apt-get install -y gifsicle
# RUN docker-php-ext-configure gd
# --with-jpeg=/usr/include
# --with-png-dir=/usr \
RUN docker-php-ext-install gd
RUN apt-get update -y \
&& apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev git \
&& pecl install memcached \
&& echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini \
&& apt-get remove -y build-essential libmemcached-dev libz-dev \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /tmp/pear \
&& curl -sS https://getcomposer.org/installer -o composer-setup.php \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& docker-php-ext-install bcmath \
&& cd /code && composer install

View File

@ -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/

View File

@ -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;
}

View File

@ -40,10 +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 php
WORKDIR "/var/www-leftypol"
WORKDIR "/var/www"
CMD ["php-fpm"]
EXPOSE 9000