-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
executable file
·56 lines (53 loc) · 1.21 KB
/
docker-compose.yaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: '3.4'
services:
dev:
container_name: nestjs_rest_api_dev
image: nestjs-api-dev:1.0.0
build:
context: .
dockerfile: ./Dockerfile
command: npm run start:dev
ports:
- ${APP_PORT_LOCAL-APP_PORT}:${APP_PORT}
networks:
- app-network
depends_on:
- postgres
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
restart: unless-stopped
prod:
container_name: nestjs_rest_api_prod
image: nestjs-api-prod:1.0.0
build:
context: .
dockerfile: ./Dockerfile
ports:
- ${APP_PORT_LOCAL-APP_PORT}:${APP_PORT}
networks:
- app-network
depends_on:
- postgres
volumes:
- /usr/src/app/node_modules
- /usr/src/app/dist
restart: unless-stopped
postgres:
image: postgres
container_name: postgres
ports:
- ${DATABASE_PORT_LOCAL-DATABASE_PORT}:${DATABASE_PORT}
env_file:
- .env
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- app-network
restart: unless-stopped
networks:
app-network: