This repository was archived by the owner on Mar 12, 2022. It is now read-only.
File tree 5 files changed +379
-264
lines changed
5 files changed +379
-264
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:lts-alpine AS production
2
+
3
+ ARG NODE_ENV=production
4
+ ENV NODE_ENV=${NODE_ENV}
5
+
6
+ WORKDIR /usr/src/app
7
+
8
+ COPY . /usr/src/app
9
+
10
+ RUN apk update && \
11
+ apk upgrade && \
12
+ apk add --no-cache git
13
+
14
+ RUN yarn global add typescript && yarn global add @nestjs/cli && yarn global add ts-node
15
+ RUN yarn install --production && yarn build
16
+
17
+ CMD ["node" , "/dist/main" ]
18
+
19
+ FROM node:lts-alpine AS development
20
+
21
+ ARG NODE_ENV=development
22
+ ENV NODE_ENV=${NODE_ENV}
23
+
24
+ WORKDIR /usr/src/app
25
+
26
+ COPY . /usr/src/app
27
+
28
+ RUN apk update && \
29
+ apk upgrade && \
30
+ apk add --no-cache git
31
+
32
+ RUN yarn global add typescript && yarn global add @nestjs/cli && yarn global add ts-node
33
+ RUN yarn && yarn build
34
+
35
+ CMD ["node" , "/dist/main" ]
Original file line number Diff line number Diff line change 1
1
version : ' 3.8'
2
2
3
3
services :
4
+ dev :
5
+ container_name : aluraflix_dev
6
+ build :
7
+ context : .
8
+ dockerfile : ./Dockerfile
9
+ target : development
10
+ depends_on :
11
+ - db
12
+ - redis
13
+ env_file :
14
+ - .env
15
+ ports :
16
+ - 3000:3000
17
+ - 9229:9229
18
+ command : npm run start:dev
19
+ volumes :
20
+ - .:/usr/src/app
21
+ - /usr/src/app/node_modules
22
+ prod :
23
+ container_name : aluraflix_prod
24
+ build :
25
+ context : .
26
+ dockerfile : ./Dockerfile
27
+ target : production
28
+ depends_on :
29
+ - db
30
+ - redis
31
+ env_file :
32
+ - .env
33
+ ports :
34
+ - 3000:3000
35
+ - 9229:9229
36
+ command : npm run start:prod
37
+ volumes :
38
+ - .:/usr/src/app
39
+ - /usr/src/app/node_modules
4
40
db :
5
41
container_name : aluraflix_pgsql
6
42
image : postgres:alpine
7
43
restart : always
8
- env_file :
9
- - .env
10
44
ports :
11
45
- ' 5432:5432'
12
- pgadmin :
13
- container_name : pgadmin4_aluraflix
14
- image : dpage/pgadmin4
15
- restart : always
16
- environment :
17
- PGADMIN_DEFAULT_EMAIL : ${PGADMIN_DEFAULT_EMAIL}
18
- PGADMIN_DEFAULT_PASSWORD : ${PGADMIN_DEFAULT_PASSWORD}
19
- ports :
20
- - ' 5050:80'
46
+ volumes :
47
+ - /usr/src/app/aluraflix/docker-volumes/db/:/var/lib/postgresql/data
21
48
redis :
22
49
container_name : aluraflix-redis
23
50
image : redis:alpine
Original file line number Diff line number Diff line change 69
69
"supertest" : " ^6.1.3" ,
70
70
"ts-jest" : " ^26.5.4" ,
71
71
"ts-loader" : " ^8.0.18" ,
72
- "ts-node" : " ^9.1 .1" ,
72
+ "ts-node" : " ^10.2 .1" ,
73
73
"tsconfig-paths" : " ^3.9.0" ,
74
74
"typescript" : " ^4.2.3"
75
75
},
Original file line number Diff line number Diff line change 9
9
"target" : " es2017" ,
10
10
"sourceMap" : true ,
11
11
"outDir" : " ./dist" ,
12
- "baseUrl" : " ./ " ,
12
+ "baseUrl" : " ." ,
13
13
"incremental" : true
14
14
}
15
15
}
You can’t perform that action at this time.
0 commit comments