-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (104 loc) · 2.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
109 lines (104 loc) · 2.68 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
106
107
108
109
version: "3.9"
services:
postgres:
image: postgres:15-alpine
container_name: byte-postgres
environment:
POSTGRES_USER: byte
POSTGRES_PASSWORD: bot
POSTGRES_DB: byte
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- byte-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U byte"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
api:
build:
context: .
dockerfile: services/api/Dockerfile
container_name: byte-api
ports:
- "8000:8000"
environment:
- DB_URL=postgresql+asyncpg://byte:bot@postgres:5432/byte
- ENVIRONMENT=dev
- DEBUG=True
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8000
- LOG_LEVEL=10
depends_on:
postgres:
condition: service_healthy
networks:
- byte-network
volumes:
# Mount source code for hot-reload in development
- ./services/api/src:/app/services/api/src:delegated
- ./packages/byte-common:/app/packages/byte-common:delegated
# Override CMD for development with reload
command:
sh -c "alembic upgrade head && uvicorn byte_api.app:create_app --factory --reload --host 0.0.0.0 --port 8000"
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
test:
[
"CMD-SHELL",
'python -c ''import urllib.request; urllib.request.urlopen("http://localhost:8000/health")'' || exit 1',
]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
bot:
build:
context: .
dockerfile: services/bot/Dockerfile
container_name: byte-bot
environment:
# Discord settings - must be provided via .env or environment
- DISCORD_TOKEN=${DISCORD_TOKEN}
- DISCORD_DEV_GUILD_ID=${DISCORD_DEV_GUILD_ID:-}
- DISCORD_DEV_USER_ID=${DISCORD_DEV_USER_ID:-}
# API service configuration
- API_SERVICE_URL=http://api:8000
- ENVIRONMENT=dev
- LOG_LEVEL=10
depends_on:
api:
condition: service_healthy
networks:
- byte-network
volumes:
# Mount source code for development
- ./services/bot/src:/app/services/bot/src:delegated
- ./packages/byte-common:/app/packages/byte-common:delegated
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
byte-network:
driver: bridge
volumes:
pgdata:
driver: local