aaaaaaaaaaaaaa

This commit is contained in:
Nathan 2026-02-02 18:54:18 -05:00
parent 1fa613f488
commit f5f688e4fa
2 changed files with 45 additions and 0 deletions

24
frontend/Dockerfile Normal file
View file

@ -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;"]

21
frontend/nginx.conf Normal file
View file

@ -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";
}
}