Skip to content

Commit 2214735

Browse files
committed
2022/dockerize: Dockerize the Frontend and Backend and add a docker-compose.yml - fix proxy.conf and package.json start commands
1 parent e0602e6 commit 2214735

32 files changed

+123
-6
lines changed

api/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Specify Node Version and Image
2+
# Name Image development (can be anything)
3+
FROM node:14 AS development
4+
5+
# Specify Working directory inside container
6+
WORKDIR /thomas/src/app
7+
8+
# Copy package-lock.json & package.json from host to inside container working directory
9+
COPY package*.json ./
10+
11+
# Install deps inside container
12+
RUN npm install
13+
14+
RUN npm run build
15+
16+
EXPOSE 3000
17+
18+
################
19+
## PRODUCTION ##
20+
################
21+
# Build another image named production
22+
FROM node:14 AS production
23+
24+
ARG NODE_ENV=production
25+
ENV NODE_ENV=${NODE_ENV}
26+
27+
# Set work dir
28+
WORKDIR /thomas/src/app
29+
30+
COPY --from=development /thomas/src/app/ .
31+
32+
EXPOSE 3000
33+
34+
# run app
35+
CMD [ "node", "dist/main"]

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
1313
"start": "nest start",
1414
"start:dev": "nest start --watch",
15-
"start:debug": "nest start --debug --watch",
15+
"start:debug": "nest start --debug 0.0.0.0:9229 --watch",
1616
"start:prod": "node dist/main",
1717
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
1818
"test": "jest",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)