update
This commit is contained in:
@@ -1,22 +1,9 @@
|
||||
FROM alpine:latest
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
RUN apk add --no-cache nginx bash curl php82 php82-fpm php82-mysqli \
|
||||
php82-pdo php82-pdo_mysql php82-gd php82-opcache php82-session \
|
||||
php82-ctype php82-dom php82-mbstring php82-zlib php82-curl tar
|
||||
# Copy Snake game HTML
|
||||
COPY index.html /usr/share/nginx/html/index.html
|
||||
|
||||
# Verzeichnisse anlegen und Rechte setzen
|
||||
RUN mkdir -p /run/nginx /var/log/nginx /var/www/html /data \
|
||||
&& chmod o+rx /data \
|
||||
&& chmod -R o+r /data \
|
||||
&& rm -rf /var/www/html \
|
||||
&& ln -s /data /var/www/html \
|
||||
&& chown -R 101:101 /data
|
||||
|
||||
# nginx config und Startskript kopieren
|
||||
# Copy custom Nginx config with stub_status
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY start.sh /start.sh
|
||||
RUN chmod +x /start.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["/start.sh"]
|
||||
EXPOSE 80 81
|
||||
|
||||
@@ -1,40 +1,29 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
worker_processes 1;
|
||||
events { worker_connections 1024; }
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 100M;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
# Snake game server
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html index.htm;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
# Metrics for Prometheus
|
||||
server {
|
||||
listen 81;
|
||||
server_name _;
|
||||
|
||||
location ~ /\.ht {
|
||||
location /nginx_status {
|
||||
stub_status;
|
||||
allow 0.0.0.0/0; # adjust for security; or restrict to your Prometheus server
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user