Added missing dependencies, fixed wrong NGINX rewrite

This commit is contained in:
tms 2023-09-25 11:19:02 +02:00
parent c0abd9decf
commit 0c0ef44420
4 changed files with 44 additions and 43 deletions

View File

@ -12,7 +12,7 @@ RUN apk --update add ca-certificates
# Install packages # Install packages
RUN apk --no-cache add php82 php82-fpm php82-opcache php82-openssl php82-curl php82-pdo php82-pdo_mysql php82-session \ RUN apk --no-cache add php82 php82-fpm php82-opcache php82-openssl php82-curl php82-pdo php82-pdo_mysql php82-session \
nginx supervisor curl unzip php82-mbstring php82-fileinfo php82-xml nginx supervisor curl unzip
# https://github.com/codecasts/php-alpine/issues/21 # https://github.com/codecasts/php-alpine/issues/21
#RUN ln -s /usr/bin/php7 /usr/bin/php #RUN ln -s /usr/bin/php7 /usr/bin/php
@ -38,7 +38,7 @@ RUN mkdir -p /var/www/html
WORKDIR /tmp WORKDIR /tmp
ADD https://github.com/omeka/omeka-s/releases/download/v4.0.4/omeka-s-4.0.4.zip /tmp ADD https://github.com/omeka/omeka-s/releases/download/v4.0.4/omeka-s-4.0.4.zip /tmp
RUN unzip omeka-s-4.0.4.zip -d /var/www/html/ && rm omeka-s-4.0.4.zip RUN unzip omeka-s-4.0.4.zip -d /var/www/html/ && rm omeka-s-4.0.4.zip
COPY config/database.ini /var/www/html/omeka-s/config/database.ini
# Make sure files/folders needed by the processes are accessable when they run under the nobody user # Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \ RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /run && \ chown -R nobody.nobody /run && \

View File

@ -0,0 +1,5 @@
user = "omeka"
password = "uzu7ZoLaiGhiequi"
dbname = "omeka"
host = "127.0.0.1"
port = "3306"

View File

@ -38,53 +38,47 @@ http {
sendfile off; sendfile off;
root /var/www/html; root /var/www/html/omeka-s;
index index.php index.html; index index.php index.html index.htm;
rewrite ^/(.*)/$ /$1 permanent;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location / { location / {
# First attempt to serve request as file, then try_files $uri /index.php?$args;
# as directory, then fall back to index.php
try_files $uri $uri/ /index.php?q=$uri&$args;
} }
# Redirect server error pages to the static page /50x.html # location /admin {
error_page 500 502 503 504 /50x.html; # try_files $uri /index.php?$args;
location = /50x.html { # }
root /var/lib/nginx/html;
}
# Pass the PHP scripts to PHP-FPM listening on 127.0.0.1:9000
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_split_path_info ^(.+\.php)(/.+)$; #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass unix:/run/php-fpm.sock; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_intercept_errors on;
fastcgi_index index.php; fastcgi_pass unix:/run/php-fpm.sock;
include fastcgi_params;
} }
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 5d; expires max;
} log_not_found off;
}
# Deny access to . files, for security }
location ~ /\. {
log_not_found off;
deny all;
}
# Allow fpm ping and status from localhost
location ~ ^/(fpm-status|fpm-ping)$ {
access_log off;
allow 127.0.0.1;
deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm.sock;
}
}
gzip on; gzip on;
gzip_proxied any; gzip_proxied any;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss; gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;

View File

@ -6,6 +6,8 @@ services:
db: db:
image: percona image: percona
restart: always restart: always
# environment: env_file:
# MYSQL_ROOT_PASSWORD: example - sample.env
ports:
- 127.0.0.1:3306:3306