-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
91 lines (85 loc) · 2.33 KB
/
docker-compose.yaml
File metadata and controls
91 lines (85 loc) · 2.33 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
services:
postgres:
# this obscure image is chosen because it has x86_64 and arm64 support
image: duvel/postgis:15-3.3
restart: unless-stopped
stop_grace_period: 0s
healthcheck:
interval: 5s
timeout: 4s
start_period: 60s
test: ["CMD", "pg_isready", "-h", "localhost", "-U", "postgres"]
environment:
- POSTGRES_DB=some_db
- POSTGRES_PASSWORD=some-password
ports:
- ${POSTGRES_PORT:-5432}:5432/tcp
migrate:
depends_on:
postgres:
condition: service_healthy
image: migrate/migrate:v4.17.1
restart: no
stop_grace_period: 0s
volumes:
- ./database/migrations:/migrations
command: >
--source file:///migrations --database postgres://postgres:some-password@postgres:5432/some_db?sslmode=disable up
post-migrate:
depends_on:
migrate:
condition: service_completed_successfully
# this obscure image is chosen because it has x86_64 and arm64 support
image: duvel/postgis:15-3.3
restart: no
stop_grace_period: 0s
entrypoint: ["/bin/bash", "-c"]
command: "PAGER=cat PGPASSWORD=some-password psql -h postgres -p 5432 -U postgres -a some_db -c 'VACUUM FULL; VACUUM ANALYZE;'"
redis:
image: redis:7.2.5
restart: unless-stopped
stop_grace_period: 0s
environment:
- REDIS_PASSWORD=some-password
ports:
- ${REDIS_PORT:-6379}:6379/tcp
command:
# point-in-time snapshots
- "--save"
- "60"
- "1"
# append-only file
- "--appendonly"
- "yes"
# keyspace notifications
- "--notify-keyspace-events"
- "sxnKEA"
# other
- "--loglevel"
- "debug"
swagger:
restart: unless-stopped
stop_grace_period: 0s
image: swaggerapi/swagger-ui:v5.4.2
environment:
- "BASE_URL=/"
- "SWAGGER_JSON_URL=http://0.0.0.0:7070/openapi.json"
ports:
- "${SWAGGER_PORT:-7071}:8080"
test:
restart: unless-stopped
stop_grace_period: 0s
build:
context: ./
dockerfile: ./Dockerfile.test
volumes:
- ./:/srv
working_dir: /srv
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=some-password
- POSTGRES_DB=some_db
- REDIS_URL=redis://redis:6379
entrypoint: ["tail", "-F", "/dev/null"]