diff --git a/Dockerfile b/Dockerfile index 8408cb5..c9aa125 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,11 +18,12 @@ RUN pnpm build # Production image FROM nginx:alpine AS runner -# Create required directories +# Create required directories for web content and logs RUN mkdir -p /usr/share/nginx/html/images/thumbnails \ /usr/share/nginx/html/subtitles \ /usr/share/nginx/html/transcriptions \ - /usr/share/nginx/html/videos + /usr/share/nginx/html/videos \ + /var/log/nginx/deafgain-website # Copy built app and static assets COPY --from=builder /app/dist /usr/share/nginx/html diff --git a/default.conf b/default.conf index 2dcdf16..4a26e8b 100644 --- a/default.conf +++ b/default.conf @@ -4,6 +4,10 @@ server { root /usr/share/nginx/html; index index.html; + # Logging configuration for statistics + access_log /var/log/nginx/deafgain-website/access.log combined; + error_log /var/log/nginx/deafgain-website/error.log error; + # Security headers add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; diff --git a/docker-compose.yml b/docker-compose.yml index 55197a8..a075555 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: restart: unless-stopped volumes: - /docker/websites/deafgain/video_content:/usr/share/nginx/html/videos + - /docker/websites/deafgain/logs:/var/log/nginx/deafgain-website networks: - caddy_network - default