-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
67 lines (57 loc) · 1.24 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: rustful
services:
postgres:
image: postgres:latest
container_name: ${DATABASE}
restart: unless-stopped
secrets:
- postgres_password
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB:-fakes}
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
ports:
- 5432:5432
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
start_period: 5s
start_interval: 10s
interval: 10s
timeout: 5s
retries: 5
networks:
- rusty_network
migration:
build:
context: .
target: migration
container_name: ${MIGRATION_CONTAINER_NAME}
depends_on:
postgres:
condition: service_healthy
networks:
- rusty_network
backend:
build:
context: .
target: final
container_name: ${BACKEND_CONTAINER_NAME}
restart: always
ports:
- 5001:5001
depends_on:
postgres:
condition: service_healthy
migration:
condition: service_completed_successfully
networks:
- rusty_network
networks:
rusty_network:
driver: bridge
volumes:
postgres-data:
secrets:
postgres_password:
file: db/pass.txt