Add docker deployment
All checks were successful
build docker image / docker-build (push) Successful in 1m40s

This commit is contained in:
Illya Marchenko 2024-11-04 18:07:51 +02:00
parent ed38c8ed64
commit 13f81622db
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
2 changed files with 18 additions and 10 deletions

View File

@ -68,14 +68,20 @@ RUN docker-php-ext-install \
pdo_sqlite \ pdo_sqlite \
bcmath bcmath
# Configure PHP # Configure php-fpm
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini 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
# Install Node.js # Install Node.js
RUN npm install -g n && n 18 RUN npm install -g n && n 18
# Apply configs # Apply configs
COPY ./docker/conf/* / COPY ./docker/conf/etc /etc
# Configure project # Configure project
WORKDIR /tmp WORKDIR /tmp
@ -86,7 +92,9 @@ COPY . .
RUN npm install \ RUN npm install \
&& npm run build \ && npm run build \
&& chown www-data:www-data . -R \ && chown www-data:www-data . -R \
&& mv /tmp/dist/* /tmp/api /var/www/html && rm -r /var/www/html/* \
&& mv /tmp/dist/* /tmp/api /var/www/html \
&& rm -r /tmp/*
WORKDIR /var/www/html WORKDIR /var/www/html

View File

@ -3,17 +3,17 @@ server {
server_name default; server_name default;
root /var/www/html; root /var/www/html;
index index.php; index index.html;
client_max_body_size 5m; client_max_body_size 5m;
client_body_timeout 60; client_body_timeout 60;
location / { location / {
try_files $uri $uri/ @rewrite; try_files $uri $uri/ /index.html;
}
location @rewrite { if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php; rewrite ^/(.*)$ /index.html last;
}
} }
location ~ \.php$ { location ~ \.php$ {
@ -23,7 +23,7 @@ server {
} }
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
try_files $uri /index.php; try_files $uri /index.html;
expires max; expires max;
log_not_found off; log_not_found off;
} }