fix
This commit is contained in:
@@ -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"]
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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;"]
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user