fix: remove nginx, serve frontend from Express on port 3000, fix static path

This commit is contained in:
BetterHuman
2026-05-06 03:54:32 +00:00
parent af9873ffed
commit f5067cc19f
3 changed files with 8 additions and 13 deletions
+4 -7
View File
@@ -18,11 +18,11 @@ COPY backend/ ./
RUN npx prisma generate --schema=src/prisma/schema.prisma
RUN npm run build
# Stage 3: Production (Debian slim to match build stage, avoiding Alpine musl/OpenSSL issues)
# Stage 3: Production (Debian slim — same glibc as build, no musl/OpenSSL issues)
FROM node:20-slim
WORKDIR /app
RUN apt-get update && apt-get install -y nginx openssl --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y openssl --no-install-recommends && rm -rf /var/lib/apt/lists/*
# Copy backend
COPY --from=backend-build /app/backend/dist ./dist
@@ -30,15 +30,12 @@ COPY --from=backend-build /app/backend/node_modules ./node_modules
COPY --from=backend-build /app/backend/src/prisma ./prisma
COPY backend/package.json ./package.json
# Copy frontend build
# Copy frontend build — served by Express at /app/public
COPY --from=frontend-build /app/frontend/dist ./public
# Nginx config
COPY nginx.conf /etc/nginx/nginx.conf
COPY start.sh ./
RUN chmod +x start.sh
EXPOSE 80
EXPOSE 3000
CMD ["./start.sh"]