mirror of
https://github.com/System-End/scraps.git
synced 2026-04-19 16:28:20 +00:00
aaaaaaaaaaaaaa
This commit is contained in:
parent
1fa613f488
commit
f5f688e4fa
2 changed files with 45 additions and 0 deletions
24
frontend/Dockerfile
Normal file
24
frontend/Dockerfile
Normal 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
21
frontend/nginx.conf
Normal 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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue