-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
46 lines (45 loc) · 1.15 KB
/
compose.yaml
File metadata and controls
46 lines (45 loc) · 1.15 KB
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:
api:
build: .
ports:
- "4000:4000"
environment:
DB_HOST: host.docker.internal
volumes:
- .:/usr/src/app # Bind your local code to the container
- /usr/src/app/node_modules # Bind node_modules to the container
- ./nodemon.json:/usr/src/app/nodemon.json # Bind Nodemon config to the container
depends_on:
db:
condition: service_healthy
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- ./data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 1s
timeout: 5s
retries: 10
adminer:
image: adminer
restart: always
ports:
- 8080:8080
migration:
build:
context: .
dockerfile: migrations/Dockerfile
environment:
DB_HOST: db
command: sh -c "npm install && chmod +x /usr/src/app/migrations/wait-for-db.sh && /usr/src/app/migrations/wait-for-db.sh && npm run migrate:latest"
restart: on-failure
depends_on:
- db