Skip to content

Commit 73b4439

Browse files
committed
Add build script
1 parent 96b68cd commit 73b4439

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
*.tsbuildinfo
1415

1516
# Coverage
1617
coverage

docker-compose-prod.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,25 @@ services:
109109
- peerprep-network
110110
restart: on-failure
111111

112-
# frontend:
113-
# image: peerprep/frontend
114-
# build: ./frontend
115-
# ports:
116-
# - 5173:5173
117-
# depends_on:
118-
# - user-service
119-
# # - question-service
120-
# # - matching-service
121-
# # - collab-service
122-
# # - code-execution-service
123-
# # - communication-service
124-
# # - qn-history-service
125-
# networks:
126-
# - peerprep-network
127-
# restart: on-failure
112+
frontend:
113+
image: peerprep/frontend
114+
build:
115+
context: ./frontend
116+
dockerfile: Dockerfile
117+
target: prod
118+
ports:
119+
- 5173:4173
120+
depends_on:
121+
- user-service
122+
- question-service
123+
- matching-service
124+
- collab-service
125+
- code-execution-service
126+
- communication-service
127+
- qn-history-service
128+
networks:
129+
- peerprep-network
130+
restart: on-failure
128131

129132
question-service-mongo:
130133
image: mongo

frontend/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ RUN npm ci
88

99
COPY . .
1010

11-
EXPOSE 5173
12-
1311
# DEV
1412

1513
FROM base AS dev
1614

15+
EXPOSE 5173
16+
1717
CMD ["npm", "run", "dev"]
1818

1919
# PROD
@@ -22,4 +22,6 @@ FROM base AS prod
2222

2323
RUN npm run build
2424

25+
EXPOSE 4173
26+
2527
CMD ["npm", "run", "preview"]

0 commit comments

Comments
 (0)