25 lines
492 B
Docker
25 lines
492 B
Docker
FROM node:20-slim AS frontend-builder
|
|
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package*.json ./
|
|
RUN npm install
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
FROM node:20-slim AS backend
|
|
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install --production
|
|
|
|
WORKDIR /app/backend
|
|
COPY backend/package*.json ./
|
|
RUN npm install --production
|
|
COPY backend/ ./
|
|
|
|
# Copy frontend build
|
|
COPY --from=frontend-builder /app/frontend/dist /app/frontend/dist
|
|
|
|
EXPOSE 3001
|
|
|
|
CMD ["node", "server.js"]
|