-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (47 loc) · 1 KB
/
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
45
46
47
48
49
50
services:
db:
image: postgres
container_name: database
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- '${DB_PORT}:${DB_PORT}'
volumes:
- db-data:/var/lib/postgresql/data
api:
container_name: server
build: .
init: true
restart: unless-stopped
environment:
- NODE_ENV=development
- PORT=${PORT}
- DB_HOST=db
- DB_PORT=${DB_PORT}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
ports:
- '${PORT}:${PORT}'
depends_on:
- db
volumes:
- .:/app
- /app/node_modules
command: ['sh', '-c', 'npm run migration:run && npm run dev']
test:
container_name: test
build: .
environment:
- NODE_ENV=test
volumes:
- .:/app
- /app/node_modules
command: ['npm', 'run', 'test']
profiles:
- test
volumes:
db-data: