-
Notifications
You must be signed in to change notification settings - Fork 35
/
docker-compose.yml
103 lines (98 loc) · 2.22 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: "3.9"
services:
backend-py:
container_name: backend-py
env_file:
- .env
depends_on:
database:
condition: service_healthy
build:
context: backend-py
target: backend-py
ports:
- "${FLASK_RUN_PORT}:${FLASK_RUN_PORT}"
# Watch and react to changes in local...
volumes:
# backend-py/src directory
- type: bind
source: ./backend-py/src
target: /backend-py/src
# data directory
- type: bind
source: ./data
target: /data
backend-ts:
container_name: backend-ts
env_file:
- .env
depends_on:
database:
condition: service_healthy
build:
context: backend-ts
target: backend-ts
ports:
- "${EXPRESS_LISTEN_PORT}:${EXPRESS_LISTEN_PORT}"
# Watch and react to changes in local...
volumes:
# backend-ts/src directory
- type: bind
source: ./backend-ts/src
target: /backend-ts/src
# data directory
- type: bind
source: ./data
target: /data
frontend:
container_name: frontend
env_file:
- .env
build:
context: frontend
target: frontend
ports:
- "${REACT_APP_PORT}:3000"
# Watch and react to changes in local...
volumes:
# frontend/src directory
- type: bind
source: ./frontend/src
target: /frontend/src
# data directory
- type: bind
source: ./data
target: /data
database:
container_name: database
env_file:
- .env
build:
context: data
target: database
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
start_period: 10s
interval: 10s
retries: 5
timeout: 5s
ports:
- "${DB_PORT}:5432"
volumes:
# Create a managed docker volume to persist data if the container shuts down
- db:/var/lib/postgresql/data
# Watch and react to changes in local data directory
- type: bind
source: ./data
target: /data
test-database:
container_name: test-database
env_file:
- .env
environment:
POSTGRES_HOST_AUTH_METHOD: trust
image: postgres:14.2
ports:
- "${TEST_DB_PORT}:5432"
volumes:
db: