-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.staging.yml
More file actions
67 lines (64 loc) · 1.78 KB
/
docker-compose.staging.yml
File metadata and controls
67 lines (64 loc) · 1.78 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
version: "3.9"
services:
backend:
image: "${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG:-latest}"
container_name: backend
restart: always
build:
context: ./backend
env_file:
- .env
ports:
- "8000:80"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/api/v1/utils/health/"]
interval: 10s
timeout: 5s
retries: 5
command: >
uv run uvicorn app.main:app --host 0.0.0.0 --port 80 --reload
develop:
watch:
# Sync backend source code into container immediately on change
- action: sync
path: ./backend/app
target: /app/app
# Rebuild image if dependencies change
- action: rebuild
path: ./backend/pyproject.toml
- action: rebuild
path: ./backend/uv.lock
logging:
driver: awslogs
options:
awslogs-region: ap-south-1
awslogs-group: /ec2/kaapi-staging
awslogs-stream: backend
awslogs-create-group: "true"
migrate:
image: "${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG:-latest}"
build:
context: ./backend
env_file:
- .env
profiles: ["migrate"]
command: ["uv", "run", "alembic", "upgrade", "head"]
celery_worker:
image: "${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG:-latest}"
container_name: celery-worker
restart: always
build:
context: ./backend
depends_on:
backend:
condition: service_healthy
env_file:
- .env
command: ["uv", "run", "celery", "-A", "app.celery.celery_app", "worker", "--loglevel=info"]
logging:
driver: awslogs
options:
awslogs-region: ap-south-1
awslogs-group: /ec2/kaapi-staging
awslogs-stream: celery-worker
awslogs-create-group: "true"