2024-11-04 16:45:27 +02:00
|
|
|
FROM php:8.3-fpm
|
|
|
|
|
|
|
|
# build arguments
|
|
|
|
ARG APP_URL http://localhost
|
|
|
|
|
|
|
|
# Update to Debian Trixie
|
|
|
|
RUN cat <<EOF >> /etc/apt/sources.list
|
|
|
|
deb http://deb.debian.org/debian trixie main contrib non-free
|
|
|
|
deb http://deb.debian.org/debian trixie-updates main contrib non-free
|
|
|
|
deb http://security.debian.org/debian-security trixie-security main contrib non-free
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get upgrade -y
|
|
|
|
|
|
|
|
# Install apps
|
|
|
|
RUN apt-get install -y --no-install-recommends \
|
|
|
|
nginx \
|
|
|
|
rsyslog \
|
|
|
|
supervisor \
|
|
|
|
curl \
|
|
|
|
wget \
|
|
|
|
npm \
|
|
|
|
nano \
|
|
|
|
cmake \
|
|
|
|
gettext \
|
|
|
|
unzip
|
|
|
|
|
|
|
|
# Install PHP dependencies
|
|
|
|
RUN apt-get install -y --no-install-recommends \
|
|
|
|
libzip-dev \
|
|
|
|
libfreetype6=2.12.1+dfsg-5+deb12u3 \
|
|
|
|
libfreetype-dev=2.12.1+dfsg-5+deb12u3 \
|
|
|
|
libpng-dev \
|
|
|
|
libjpeg62-turbo-dev \
|
|
|
|
libwebp-dev \
|
|
|
|
libmcrypt-dev \
|
|
|
|
libbz2-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libtidy-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
libonig-dev \
|
|
|
|
libc-client-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libkrb5-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
freetds-dev \
|
|
|
|
freetds-bin
|
|
|
|
|
|
|
|
# Cleanup APT
|
|
|
|
RUN rm -rf \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/usr/share/man/* \
|
|
|
|
/usr/share/doc/* \
|
|
|
|
/etc/nginx/sites-enabled
|
|
|
|
|
|
|
|
# Install PHP extensions
|
|
|
|
RUN docker-php-ext-install \
|
|
|
|
mbstring \
|
|
|
|
xml \
|
|
|
|
dom \
|
|
|
|
zip \
|
|
|
|
intl \
|
|
|
|
gd \
|
|
|
|
curl \
|
|
|
|
calendar \
|
|
|
|
pdo_sqlite \
|
|
|
|
bcmath
|
|
|
|
|
2024-11-04 18:07:51 +02:00
|
|
|
# Configure php-fpm
|
|
|
|
RUN sed -i 's/listen = 127.0.0.1:9000/listen = \/run\/php\/php-fpm.sock/' /usr/local/etc/php-fpm.d/www.conf \
|
|
|
|
&& sed -i 's/;listen.owner = www-data/listen.owner = www-data/' /usr/local/etc/php-fpm.d/www.conf \
|
|
|
|
&& sed -i 's/;listen.group = www-data/listen.group = www-data/' /usr/local/etc/php-fpm.d/www.conf \
|
|
|
|
&& sed -i 's/;listen.mode = 0660/listen.mode = 0660/' /usr/local/etc/php-fpm.d/www.conf \
|
|
|
|
&& cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
|
|
|
|
&& sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 200M/' /usr/local/etc/php/php.ini \
|
|
|
|
&& sed -i 's/post_max_size = 8M/post_max_size = 200M/' /usr/local/etc/php/php.ini
|
2024-11-04 17:20:43 +02:00
|
|
|
|
2024-11-04 16:45:27 +02:00
|
|
|
# Install Node.js
|
|
|
|
RUN npm install -g n && n 18
|
|
|
|
|
|
|
|
# Apply configs
|
2024-11-04 18:07:51 +02:00
|
|
|
COPY ./docker/conf/etc /etc
|
2024-11-04 16:45:27 +02:00
|
|
|
|
|
|
|
# Configure project
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
# Install project
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN npm install \
|
|
|
|
&& npm run build \
|
2024-11-04 16:55:31 +02:00
|
|
|
&& chown www-data:www-data . -R \
|
2024-11-04 18:07:51 +02:00
|
|
|
&& rm -r /var/www/html/* \
|
|
|
|
&& mv /tmp/dist/* /tmp/api /var/www/html \
|
|
|
|
&& rm -r /tmp/*
|
2024-11-04 16:45:27 +02:00
|
|
|
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
|
|
|
|
COPY ./entrypoint.sh /
|
|
|
|
|
|
|
|
CMD ["/bin/bash", "/entrypoint.sh"]
|