-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (55 loc) · 1.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
58 lines (55 loc) · 1.58 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
# Development and production orchestration for AI Code Assistant.
#
# Usage:
# docker compose up --build # start web + postgres
# docker compose down # stop everything
#
# The web service applies pending migrations before starting gunicorn.
services:
web:
build:
context: .
dockerfile: Dockerfile
container_name: aica-web
env_file:
- .env
environment:
APP_ENV: production
SECRET_KEY: ${SECRET_KEY:-insecure-dev-secret-change-me}
DATABASE_URL: postgresql://aica:aica_secret@db:5432/aica
ports:
- "5000:5000"
volumes:
- ./migrations:/app/migrations:ro
depends_on:
db:
condition: service_healthy
command: >
sh -c "flask db upgrade &&
gunicorn --bind 0.0.0.0:5000 --workers 3 --timeout 120 wsgi:app"
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health', timeout=3)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
db:
image: postgres:16-alpine
container_name: aica-db
environment:
POSTGRES_USER: ${POSTGRES_USER:-aica}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-aica_secret}
POSTGRES_DB: ${POSTGRES_DB:-aica}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-aica} -d ${POSTGRES_DB:-aica}"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
volumes:
postgres_data: