-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (23 loc) · 739 Bytes
/
Dockerfile
File metadata and controls
26 lines (23 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Stage 1: Build the frontend
FROM node:21-alpine AS frontend-builder
WORKDIR /app/frontend
COPY sheet-api-fe/package.json sheet-api-fe/package-lock.json ./
RUN npm install
COPY sheet-api-fe/ .
ARG SERVICE_ACCOUNT_EMAIL
RUN npm run generate
# Stage 2: Build the backend
FROM node:21-alpine AS backend-builder
WORKDIR /app/backend
COPY sheet-api-be/package.json sheet-api-be/package-lock.json ./
RUN npm install
COPY sheet-api-be/ .
# Copy frontend build output into backend public folder
RUN mkdir -p public
COPY --from=frontend-builder /app/frontend/.output/public ./public
# Stage 3: Create a minimal runtime image
FROM node:21-alpine
WORKDIR /app
COPY --from=backend-builder /app/backend ./
EXPOSE 3000
CMD ["npm", "run", "start"]