fix
This commit is contained in:
@@ -36,6 +36,10 @@ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
# Copy compiled application
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Run as non-root user
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
USER appuser
|
||||
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]
|
||||
|
||||
@@ -40,7 +40,7 @@ services:
|
||||
args:
|
||||
- VITE_API_URL=${API_URL}
|
||||
ports:
|
||||
- "5173:80"
|
||||
- "5173:8080"
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
|
||||
@@ -12,12 +12,11 @@ RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
FROM nginxinc/nginx-unprivileged:alpine-slim
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen 8080;
|
||||
server_name localhost;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
Reference in New Issue
Block a user