diff --git a/docker-compose.yml b/docker-compose.yml index 9e18f31..fe9f0c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: ports: - "443:443" volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./nginx.dev.conf:/etc/nginx/nginx.conf:ro - ./certs:/etc/nginx/certs:ro depends_on: - backend diff --git a/frontend/Dockerfile.prod b/frontend/Dockerfile.prod index 4fd9bcb..f87c5f0 100644 --- a/frontend/Dockerfile.prod +++ b/frontend/Dockerfile.prod @@ -17,6 +17,9 @@ RUN npm run build # Stage 2: Serve the app with Nginx FROM nginx:stable-alpine3.17 +# Copy the custom Nginx configuration +COPY nginx.prod.conf /etc/nginx/conf.d/default.conf + # Copy the build output to replace the default nginx contents. COPY --from=build /app/dist /usr/share/nginx/html diff --git a/nginx.conf b/nginx.dev.conf similarity index 100% rename from nginx.conf rename to nginx.dev.conf diff --git a/nginx.prod.conf b/nginx.prod.conf new file mode 100644 index 0000000..60d2005 --- /dev/null +++ b/nginx.prod.conf @@ -0,0 +1,9 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file