-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-pg.yaml
130 lines (128 loc) · 2.64 KB
/
docker-compose-pg.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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3.9"
services:
cache:
image: redis:latest
ports:
- "6379:6379"
hostname: cache
command: redis-server --appendonly yes
volumes:
- cache-data:/data
environment:
ALLOW_EMPTY_PASSWORD: "yes"
restart: unless-stopped
logging:
options:
max-size: 10m
max-file: "3"
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 1s
timeout: 3s
retries: 30
db:
image: postgres:latest
ports:
- "5432:5432"
hostname: db
environment:
POSTGRES_PASSWORD: "app"
POSTGRES_USER: "app"
POSTGRES_DB: "app"
volumes:
- db-data:/var/lib/postgresql/data
restart: unless-stopped
logging:
options:
max-size: 10m
max-file: "3"
healthcheck:
test:
- CMD
- pg_isready
- -U
- app
interval: 2s
timeout: 3s
retries: 40
sprintlog:
build:
context: .
dockerfile: Dockerfile.bullseye
# restart: always
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
ports:
- "8000:8000"
volumes:
- .:/app/workspace/
env_file:
- .env
command: poetry run litestar run-all --reload
pgweb:
image: sosedoff/pgweb:latest
environment:
PGWEB_DATABASE_URL: postgres://app:app@db:5432/app?sslmode=disable
ports:
- 8081:8081
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "nc", "-vz", "127.0.0.1", "8081"]
interval: 5s
migrator:
build:
context: .
dockerfile: Dockerfile.bullseye
no_cache: true
restart: "no"
command: poetry run litestar database upgrade
env_file:
- .env
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
# migration-gen:
# condition: service_completed_successfully
volumes:
- .:/app/workspace/
revision:
build:
context: .
dockerfile: Dockerfile.bullseye
restart: "no"
command: poetry run alembic -c src/app/lib/db/alembic.ini revision --autogenerate
profiles:
- "rev"
env_file:
- .env
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
volumes:
- .:/app/workspace/
localmail:
image: mailhog/mailhog:v1.0.0
ports:
- "8025:8025"
localcdn:
image: sigoden/dufs
ports:
- 8866:5000
volumes:
- ./static:/data
command: /data -A --enable-cors --render-index
volumes:
db-data: {}
cache-data: {}