This commit is contained in:
2026-02-18 19:31:47 +01:00
parent c3d1dcab4c
commit 658a70f3ac
4 changed files with 8 additions and 5 deletions

View File

@@ -36,6 +36,10 @@ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
# Copy compiled application # Copy compiled application
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
# Run as non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser
EXPOSE 3001 EXPOSE 3001
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"] CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]

View File

@@ -40,7 +40,7 @@ services:
args: args:
- VITE_API_URL=${API_URL} - VITE_API_URL=${API_URL}
ports: ports:
- "5173:80" - "5173:8080"
depends_on: depends_on:
- backend - backend

View File

@@ -12,12 +12,11 @@ RUN npm ci
COPY . . COPY . .
RUN npm run build RUN npm run build
# Production stage FROM nginxinc/nginx-unprivileged:alpine-slim
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,5 +1,5 @@
server { server {
listen 80; listen 8080;
server_name localhost; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;