-
-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 540 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (20 loc) · 540 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
27
28
# Base image
FROM node:20
# Build arg & env
ARG MODE=prod
ENV NODE_ENV=$MODE
# Create app dir
WORKDIR /app
# Install concurrently
RUN npm install -g concurrently
# Copy backend dependencies
COPY package*.json ./
RUN npm install
# Copy frontend dependencies
COPY frontend/package*.json ./frontend/
RUN cd frontend && npm install
COPY . .
# Expose frontend (3000) và backend (3004)
EXPOSE 3000
EXPOSE 3004
CMD sh -c 'if [ "$MODE" = "dev" ]; then concurrently "cd frontend && npm start" "npm run start-dev"; else npm run start; fi'