diff --git a/docker-compose.yml b/docker-compose.yml index df616eb..8637c27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,20 +3,17 @@ version: '3.8' services: frontend: build: - context: ./frontend - dockerfile: ../docker/frontend/Dockerfile + context: . + dockerfile: docker/frontend/Dockerfile container_name: support-frontend restart: unless-stopped - volumes: - - ./frontend:/app - - /app/node_modules depends_on: - backend backend: build: - context: ./backend - dockerfile: ../docker/backend/Dockerfile + context: . + dockerfile: docker/backend/Dockerfile container_name: support-backend restart: unless-stopped environment: @@ -27,15 +24,13 @@ services: - sqlite_data:/app/instance nginx: - image: nginx:alpine + build: + context: . + dockerfile: docker/frontend/Dockerfile container_name: support-nginx restart: unless-stopped ports: - "80:80" - volumes: - - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - - ./docker/nginx/conf.d:/etc/nginx/conf.d:ro - - ./frontend/dist:/usr/share/nginx/html:ro depends_on: - frontend - backend diff --git a/docker/nginx/conf.d/default.conf b/docker/nginx/conf.d/default.conf index 1879958..6c22cd1 100644 --- a/docker/nginx/conf.d/default.conf +++ b/docker/nginx/conf.d/default.conf @@ -1,22 +1,21 @@ # docker/nginx/conf.d/default.conf upstream backend { - server backend:8000; # Changed port to match FastAPI default + server backend:8000; } server { listen 80; server_name localhost; - root /usr/share/nginx/html; - index index.html; - - # Handle frontend routes location / { + root /usr/share/nginx/html; + index index.html; try_files $uri $uri/ /index.html; - add_header Cache-Control "no-cache"; + + # Disable caching for index.html + add_header Cache-Control "no-store, no-cache, must-revalidate"; } - # Proxy API requests to backend location /api/ { proxy_pass http://backend/; proxy_http_version 1.1; @@ -28,4 +27,10 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + # Handle favicon.ico + location = /favicon.ico { + access_log off; + log_not_found off; + } }