From d8661d50259560e9b478918f262d00f657a71256 Mon Sep 17 00:00:00 2001 From: Ben Stull Date: Wed, 3 Jun 2026 22:31:03 -0700 Subject: [PATCH] test(tier1): nginx web image serving the built SPA Co-Authored-By: Claude Opus 4.8 --- testing/web.Dockerfile | 12 ++++++++++++ testing/web.nginx.conf | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 testing/web.Dockerfile create mode 100644 testing/web.nginx.conf diff --git a/testing/web.Dockerfile b/testing/web.Dockerfile new file mode 100644 index 0000000..08985ce --- /dev/null +++ b/testing/web.Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-slim AS build +WORKDIR /app +COPY frontend/package.json frontend/package-lock.json /app/ +RUN npm ci +COPY frontend/ /app/ +ENV VITE_APP_NAME="RFC Tier1" +RUN npm run build + +FROM nginx:1.27-alpine +COPY testing/web.nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 80 diff --git a/testing/web.nginx.conf b/testing/web.nginx.conf new file mode 100644 index 0000000..0b4b496 --- /dev/null +++ b/testing/web.nginx.conf @@ -0,0 +1,25 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location /api/ { + proxy_pass http://backend:8000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 300s; + } + + location /auth/ { + proxy_pass http://backend:8000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location / { + try_files $uri $uri/ /index.html; + } +}