fix(fileserver): nginx conf

This commit is contained in:
ange 2024-02-28 13:18:16 +01:00
parent ece527c30b
commit e1793f9c6f
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
5 changed files with 26 additions and 3 deletions

View File

@ -1,4 +1,4 @@
BASE_URL=ftp. BASE_URL=files.
EMAIL= EMAIL=
FILES=./files/ FILES=./files/

3
fileserver/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM docker.io/nginx:latest
COPY default.conf /etc/nginx/conf.d/
COPY entrypoint.sh /docker-entrypoint.d/99-entrypoint.sh

View File

@ -13,10 +13,10 @@ services:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
fileserver: fileserver:
image: docker.io/nginx:latest build: .
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- "$FILES:/usr/share/nginx/html:ro" - "$FILES:/files/:ro"
networks: networks:
- nginx - nginx

11
fileserver/default.conf Normal file
View File

@ -0,0 +1,11 @@
server {
listen 80;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
location / {
root /files;
}
}

9
fileserver/entrypoint.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash -e
if [ -n "$PGID" ]; then
groupmod -g "$PGID" nginx
fi
if [ -n "$PUID" ]; then
usermod -u "$PUID" nginx
fi