chore: productionize compose deployment
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
FROM node:20-alpine AS frontend-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=frontend-build /app/dist /usr/share/nginx/html
|
||||
+3
-10
@@ -20,11 +20,8 @@ http {
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream frontend {
|
||||
zone frontend 64k;
|
||||
server frontend:5173 resolve;
|
||||
}
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
upstream backend {
|
||||
zone backend 64k;
|
||||
@@ -62,11 +59,7 @@ http {
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://frontend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user