-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.66 KB
/
docker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.66 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
services:
app:
build: .
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/demo_saas
REDIS_URL: redis://redis:6379/0
JWT_SECRET: dev-jwt-secret-min-32-chars-for-hs256!!
DEMO_AUTO_RESET_MINUTES: "15"
CORS_ALLOW_ORIGINS: "https://saas-skeleton.flacsy.dev"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\" || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
# Демо-данные. Запуск: docker compose run --rm seed
# Сброс к чистому состоянию: перезапустить этот сервис
seed:
build: .
environment:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/demo_saas
depends_on:
postgres:
condition: service_healthy
command: python scripts/seed_demo.py
profiles:
- seed
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: demo_saas
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 5s
retries: 10
volumes:
postgres_data: