diff options
author | Freya Murphy <freya@freyacat.org> | 2025-02-07 16:06:51 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-02-07 16:06:51 -0500 |
commit | 3b6fd9bae4b17f2184c9cec5a2cc5c9d9473d7fa (patch) | |
tree | db7e4534a61020f29c14f28b6130523ea2028bad | |
parent | fix john (diff) | |
download | rit.wtf-3b6fd9bae4b17f2184c9cec5a2cc5c9d9473d7fa.tar.gz rit.wtf-3b6fd9bae4b17f2184c9cec5a2cc5c9d9473d7fa.tar.bz2 rit.wtf-3b6fd9bae4b17f2184c9cec5a2cc5c9d9473d7fa.zip |
fix docker
-rw-r--r-- | Dockerfile | 8 | ||||
-rw-r--r-- | conf/nginx.conf | 28 | ||||
-rw-r--r-- | docker-compose.yml | 12 |
3 files changed, 38 insertions, 10 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0fef266..0000000 --- a/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM alpine:latest - -RUN apk add --no-cache php - -COPY . /app -WORKDIR /app - -CMD ["php", "-S", "0.0.0.0:80"] diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..12725f1 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,28 @@ +worker_processes 4; + +events { + worker_connections 1024; +} + +http { + include mime.types; + sendfile on; + + server { + listen 80; + root /var/www/html; + + location /public { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location / { + add_header Content-Security-Policy "base-uri 'none'"; + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_param SCRIPT_FILENAME $document_root/index.php; + } + } +} + diff --git a/docker-compose.yml b/docker-compose.yml index 0eae993..2635a91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,14 @@ services: - rit: - build: . + web: + image: nginx:alpine restart: unless-stopped + volumes: + - ./conf/nginx.conf:/etc/nginx/nginx.conf + - ./:/var/www/html:ro ports: - '80:80' + php: + image: php:8-fpm + restart: unless-stopped + volumes: + - ./:/var/www/html:ro |