-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (99 loc) · 3 KB
/
docker-compose.yml
File metadata and controls
105 lines (99 loc) · 3 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: "3.8"
services:
postgres:
image: postgres:17-alpine
container_name: ${PROJECT_NAME:-generic}-postgres
ports:
- "5433:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ${PROJECT_NAME:-generic}
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: ${PROJECT_NAME:-generic}-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
app:
build:
context: .
dockerfile: py/Dockerfile
args:
BUILDKIT_INLINE_CACHE: 1
container_name: ${PROJECT_NAME:-generic}-py-app
ports:
- "8000:8000"
environment:
POSTGRES_URL: postgresql://postgres:postgres@postgres:5432/${PROJECT_NAME:-generic}
REDIS_URL: redis://redis:6379
HOST_NAME: http://localhost:8000
DEBUG: "true"
GOOGLE_O_AUTH_CLIENT_ID: ${GOOGLE_O_AUTH_CLIENT_ID}
GOOGLE_O_AUTH_CLIENT_SECRET: ${GOOGLE_O_AUTH_CLIENT_SECRET}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
worker:
build:
context: .
dockerfile: py/Dockerfile
args:
BUILDKIT_INLINE_CACHE: 1
container_name: ${PROJECT_NAME:-generic}-worker
command: ["sh", "-c", "cd /app/apps/py-app && uv run taskiq worker src.tasks:broker --fs-discover --tasks-pattern '**/tasks/**/*.py'"]
environment:
POSTGRES_URL: postgresql://postgres:postgres@postgres:5432/${PROJECT_NAME:-generic}
REDIS_URL: redis://redis:6379
GOOGLE_O_AUTH_CLIENT_ID: ${GOOGLE_O_AUTH_CLIENT_ID}
GOOGLE_O_AUTH_CLIENT_SECRET: ${GOOGLE_O_AUTH_CLIENT_SECRET}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
scheduler:
build:
context: .
dockerfile: py/Dockerfile
args:
BUILDKIT_INLINE_CACHE: 1
container_name: ${PROJECT_NAME:-generic}-scheduler
command: ["sh", "-c", "cd /app/apps/py-app && uv run taskiq scheduler src.tasks.scheduler:scheduler"]
environment:
POSTGRES_URL: postgresql://postgres:postgres@postgres:5432/${PROJECT_NAME:-generic}
REDIS_URL: redis://redis:6379
GOOGLE_O_AUTH_CLIENT_ID: ${GOOGLE_O_AUTH_CLIENT_ID}
GOOGLE_O_AUTH_CLIENT_SECRET: ${GOOGLE_O_AUTH_CLIENT_SECRET}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
postgres-data:
name: ${PROJECT_NAME:-generic}-postgres-data
redis-data:
name: ${PROJECT_NAME:-generic}-redis-data