Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ jobs:
- name: Run unit tests
run: npm run test
- name: Build frontend
run: npm run build
run: npm run build
4 changes: 2 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN npm run build
# Production stage
FROM nginx:1.27-alpine

RUN apk upgrade --no-cache libcrypto3 libssl3
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3

# Non-root user
RUN chown -R nginx:nginx /var/cache/nginx /var/log/nginx /etc/nginx/conf.d \
Expand All @@ -27,4 +27,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:8080/ || exit 1


CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
16 changes: 16 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ server {
add_header Cache-Control "public, immutable";
}

# Backend API proxy (required for SPA integration)
# Proxies /api/* to the FastAPI backend running in the docker-compose network.
location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# SSE streaming (EventSource) compatibility
proxy_buffering off;
proxy_cache off;

proxy_pass http://api:8081;
}

# Health check endpoint (returns 200)
location /healthz {
return 200 'ok';
Expand Down
Loading