-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
60 lines (56 loc) · 1.74 KB
/
docker-compose.postgres.yml
File metadata and controls
60 lines (56 loc) · 1.74 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
services:
lovely-eye:
build: ../
ports:
- "${PORT:-8080}:8080"
environment:
- DB_DRIVER=postgres
- DB_DSN=postgres://${POSTGRES_USER:-lovely}:${POSTGRES_PASSWORD:-lovely}@lovely-eye-db:5432/${POSTGRES_DB:-lovely_eye}?sslmode=disable
- JWT_SECRET=${JWT_SECRET:-}
- INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD}
- INITIAL_ADMIN_USERNAME=${INITIAL_ADMIN_USERNAME}
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 5s
timeout: 5s
retries: 10
depends_on:
lovely-eye-db:
condition: service_healthy
networks:
- lovely-eye-net
restart: unless-stopped
seed-example-data:
build: ../
command: ["./load-example-data"]
environment:
- DB_DRIVER=postgres
- DB_DSN=postgres://${POSTGRES_USER:-lovely}:${POSTGRES_PASSWORD:-lovely}@lovely-eye-db:5432/${POSTGRES_DB:-lovely_eye}?sslmode=disable
- JWT_SECRET=${JWT_SECRET:-}
- INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD}
- INITIAL_ADMIN_USERNAME=${INITIAL_ADMIN_USERNAME}
depends_on:
lovely-eye:
condition: service_healthy
networks:
- lovely-eye-net
lovely-eye-db:
image: postgres:18.3-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:-lovely}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-lovely}
- POSTGRES_DB=${POSTGRES_DB:-lovely_eye}
volumes:
- lovely-eye-data:/var/lib/postgresql
networks:
- lovely-eye-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lovely} -d ${POSTGRES_DB:-lovely_eye}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
lovely-eye-data:
networks:
lovely-eye-net: