-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yaml
46 lines (46 loc) · 946 Bytes
/
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
services:
server:
build:
context: .
dockerfile: Dockerfile
environment:
NODE_ENV: production
env_file:
- .env
ports:
- 9000:9000
depends_on:
db:
condition: service_healthy
container_name: profiles-server
db:
image: postgres
restart: always
user: ${POSTGRES_USER}
volumes:
- db-data:/var/lib/postgresql/data
env_file:
- .env
ports:
- 25432:5432
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
container_name: profiles-db
migration:
build:
context: .
dockerfile: Dockerfile
depends_on:
- server
env_file:
- .env
command: sh -c "npx knex migrate:latest --knexfile=./knexfile.js"
volumes:
- ./knexfile.js:/home/node/app/knexfile.js
- ./db:/home/node/app/db
container_name: profiles-migration
volumes:
db-data: