File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Common variables
2
2
BUILD_ENV = dev
3
3
4
+ # Frontend variables
5
+ FRONTEND_PORT = 3000
6
+
4
7
# Question service variables
5
- QUESTION_SVC_PORT = 8001
8
+ QUESTION_SVC_PORT = 8000
6
9
QUESTION_SVC_DB_URI =
7
10
8
11
Original file line number Diff line number Diff line change 1
1
services :
2
+ frontend :
3
+ build :
4
+ context : ./frontend
5
+ target : $BUILD_ENV
6
+ ports :
7
+ - $FRONTEND_PORT:$FRONTEND_PORT
8
+ volumes :
9
+ - ./frontend:/app
10
+ - /app/node_modules
11
+ depends_on :
12
+ - question-service
13
+ - user-service
2
14
question-service :
3
15
build :
4
16
context : ./question-service
Original file line number Diff line number Diff line change
1
+ node_modules
2
+ .next
Original file line number Diff line number Diff line change
1
+ # Build stage
2
+ FROM node:20-alpine AS base
3
+ WORKDIR /app
4
+ COPY package.json yarn.lock ./
5
+ RUN yarn install --frozen-lockfile
6
+
7
+ # Development stage
8
+ FROM base AS dev
9
+ COPY . .
10
+ CMD ["yarn" , "dev" ]
11
+
12
+ # Production build stage
13
+ FROM base AS build
14
+ COPY . .
15
+ RUN yarn build
16
+
17
+ # Production runtime stage
18
+ FROM node:20-alpine AS prod
19
+ WORKDIR /app
20
+ COPY --from=build /app/package.json /app/yarn.lock ./
21
+ COPY --from=build /app/.next ./.next
22
+ COPY --from=build /app/public ./public
23
+ RUN yarn install --production --frozen-lockfile
24
+ CMD ["yarn" , "start" ]
You can’t perform that action at this time.
0 commit comments