-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (96 loc) · 2.62 KB
/
docker-compose.yml
File metadata and controls
100 lines (96 loc) · 2.62 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
name: pyro-annotator
services:
# PostgreSQL database
postgres:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
- POSTGRES_USER=dummy_pg_user
- POSTGRES_PASSWORD=dummy_pg_pwd
- POSTGRES_DB=dummy_pg_db
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U dummy_pg_user -d dummy_pg_db'"]
interval: 10s
timeout: 20s
retries: 10
# LocalStack S3 service
localstack:
image: localstack/localstack:1.4.0
ports:
- "4566:4566"
environment:
- EDGE_PORT=4566
- SERVICES=s3
- PERSISTENCE=1
volumes:
- ./annotation_api/scripts/localstack:/etc/localstack/init/ready.d
- localstack_data:/var/lib/localstack
healthcheck:
test: ["CMD-SHELL", "awslocal --endpoint-url=http://localhost:4566 s3 ls s3://admin"]
interval: 10s
timeout: 20s
retries: 10
# Annotation API backend
annotation_api:
build:
context: ./annotation_api
dockerfile: ./Dockerfile
tags:
- "pyronear/annotation-api:latest"
depends_on:
postgres:
condition: service_healthy
localstack:
condition: service_healthy
ports:
- "5050:5050"
environment:
- SUPPORT_EMAIL=contact@pyronear.org
# DB
- POSTGRES_URL=postgresql+asyncpg://dummy_pg_user:dummy_pg_pwd@postgres/dummy_pg_db
# S3
- S3_ENDPOINT_URL=http://localstack:4566
- S3_ACCESS_KEY=fake
- S3_SECRET_KEY=fake
- S3_REGION=us-east-1
- S3_PROXY_URL=http://localhost:4566
# Authentication
- AUTH_USERNAME=admin
- AUTH_PASSWORD=admin12345
- JWT_SECRET=your_jwt_secret_key_change_in_production_please
- ACCESS_TOKEN_EXPIRE_HOURS=24
restart: unless-stopped
command: "sh -c 'python app/db.py && uvicorn app.main:app --host 0.0.0.0 --port 5050 --proxy-headers'"
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:5050/status"]
interval: 10s
timeout: 20s
retries: 10
# Frontend React application
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
args:
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
- VITE_ENVIRONMENT=production
tags:
- "pyronear/annotation-app:latest"
depends_on:
annotation_api:
condition: service_healthy
ports:
- "3000:80"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
localstack_data: