-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
44 lines (44 loc) · 970 Bytes
/
docker-compose.yml
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
version: '3.7'
networks:
dockernet:
name: '${APP_NAME}'
services:
api:
build:
context: .
target: build
args:
buildcmd: npm run build
command: 'npm run start:debug'
container_name: '${APP_NAME}'
environment:
- 'NODE_ENV=${NODE_ENV}'
image: '${APP_NAME}:latest'
init: true
networks:
- dockernet
ports:
- '${APP_PORT}:3000'
- '${APP_PORT_DEBUG}:9229'
volumes:
- '.:/usr/src/app'
- /usr/src/app/node_modules
depends_on:
- db
db:
container_name: '${APP_NAME}-db'
image: 'postgres:alpine'
environment:
- 'POSTGRES_USER=${DB_USER}'
- 'POSTGRES_PASSWORD=${DB_PSWD}'
- 'POSTGRES_DB=${APP_NAME}'
- PGDATA=/var/lib/postgresql/data/pgdata
networks:
- dockernet
ports:
- '${DB_CLIENT_PORT}:5432'
volumes:
- 'dockervolume:/var/lib/postgresql/data'
volumes:
dockervolume:
name: '${APP_NAME}-db'