From f5f688e4fa47a61b49f47a123ff213d9bf95fd18 Mon Sep 17 00:00:00 2001 From: Nathan <70660308+NotARoomba@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:54:18 -0500 Subject: [PATCH] aaaaaaaaaaaaaa --- frontend/Dockerfile | 24 ++++++++++++++++++++++++ frontend/nginx.conf | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 frontend/Dockerfile create mode 100644 frontend/nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..498411c --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,24 @@ +# Build stage +FROM oven/bun:1 AS builder + +WORKDIR /app + +COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile + +COPY . . + +ARG PUBLIC_API_URL +ENV PUBLIC_API_URL=$PUBLIC_API_URL + +RUN bun run build + +# Production stage - serve static files with nginx +FROM nginx:alpine + +COPY --from=builder /app/build /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..3971ae6 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Gzip compression + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript; + + # SPA fallback - serve 200.html for client-side routing + location / { + try_files $uri $uri/ /200.html; + } + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +}