Repository navigation
Expand file tree
/
Copy pathdev.docker-compose.yml
More file actions
74 lines (74 loc) 路 1.91 KB
/
Copy pathdev.docker-compose.yml
File metadata and controls
74 lines (74 loc) 路 1.91 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
services:
web:
build:
context: ./app
dockerfile: Dockerfile
depends_on:
server:
condition: service_healthy
ports:
- 8080:80
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
labels:
- "com.centurylinklabs.watchtower.enable=true"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost/health"]
interval: 10s
timeout: 3s
retries: 5
server:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER:?POSTGRES_USER is required}:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}@postgres:5432/${POSTGRES_DB:?POSTGRES_DB is required}?sslmode=disable
ports:
- 8081:8080
volumes:
- "./persistence/migrations/:/app/persistence/migrations/"
depends_on:
postgres:
condition: service_healthy
restart: on-failure:5
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
labels:
- "com.centurylinklabs.watchtower.enable=true"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/healthz"]
interval: 10s
timeout: 3s
retries: 12
start_period: 10s
postgres:
image: postgres:14
environment:
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER is required}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_DB: ${POSTGRES_DB:?POSTGRES_DB is required}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- 5432:5432
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 5s
timeout: 5s
retries: 12
start_period: 5s
volumes:
postgres-data: