-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
50 lines (50 loc) · 992 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
47
48
49
50
services:
migrate:
build:
context: .
target: migration
command: ["sqlx", "migrate", "run"]
env_file:
- .env
environment:
DATABASE_URL: ${DATABASE_URL}
depends_on:
db:
condition: service_healthy
restart: "no"
server:
build:
context: .
target: final
ports:
- 8080:8080
env_file:
- .env
environment:
DATABASE_URL: ${DATABASE_URL}
depends_on:
db:
condition: service_healthy
db:
image: postgres:15-alpine
restart: always
user: postgres
secrets:
- db-password
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=cats_social
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
expose:
- 5432
healthcheck:
test: ['CMD', 'pg_isready']
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data:
secrets:
db-password:
file: db/password.txt