-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
75 lines (71 loc) · 1.6 KB
/
compose.yaml
File metadata and controls
75 lines (71 loc) · 1.6 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
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
services:
server-prod:
build:
context: .
target: final
ports:
- ${PORT:-2023}:${PORT:-2023}
networks:
- dbnetwork
profiles:
- prod
environment:
- DATABASE_URL=postgres://tau:${DOCKER_DB_PASSWORD}@db-prod:5432/tau
- PORT=${PORT}
- SECRET=${SECRET}
- FRONTEND_ORIGIN=${FRONTEND_ORIGIN}
depends_on:
db-prod:
condition: service_healthy
db-prod:
image: postgres:17.2
restart: always
user: postgres
networks:
- dbnetwork
profiles:
- prod
secrets:
- dbpassword
- dbrootpassword
environment:
- DOCKER_DB_PASSWORD_FILE=/run/secrets/dbpassword
- POSTGRES_PASSWORD_FILE=/run/secrets/dbrootpassword
volumes:
- dbdata:/var/lib/postgresql/data
- ./dbinit.sh:/docker-entrypoint-initdb.d/dbinit.sh
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
db-dev:
image: postgres:17.2
user: postgres
ports:
- "5432:5432"
profiles:
- dev
secrets:
- dbrootpassword
environment:
- POSTGRES_PASSWORD_FILE=/run/secrets/dbrootpassword
- FRONTEND_ORIGIN=http://localhost:3000
volumes:
- dbdevdata:/var/lib/postgresql/data
- ./dbinit-dev.sh:/docker-entrypoint-initdb.d/dbinit-dev.sh
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
volumes:
dbdata:
dbdevdata:
networks:
dbnetwork:
secrets:
dbpassword:
environment: DOCKER_DB_PASSWORD
dbrootpassword:
environment: DOCKER_DB_ROOT_PASSWORD