-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 2.22 KB
/
docker-compose.yml
File metadata and controls
87 lines (82 loc) · 2.22 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
services:
postgres:
image: postgres:16-alpine
container_name: mathalama-focus-postgres
environment:
POSTGRES_USER: mathalama
POSTGRES_PASSWORD: mathalama
POSTGRES_DB: mathalama
ports:
- "5433:5432"
volumes:
- focus_pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mathalama -d mathalama"]
interval: 10s
timeout: 5s
retries: 5
migrate:
build:
context: ./backend
dockerfile: Dockerfile
image: mathalama-focus-backend:local
container_name: mathalama-focus-migrate
depends_on:
postgres:
condition: service_healthy
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgres://mathalama:mathalama@postgres:5432/mathalama?sslmode=disable
MIGRATIONS_DIR: /app/migrations
entrypoint: ["/app/migrate"]
restart: "no"
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: mathalama-focus-backend:local
container_name: mathalama-focus-backend
depends_on:
migrate:
condition: service_completed_successfully
env_file:
- ./backend/.env
environment:
PORT: "8080"
DATABASE_URL: postgres://mathalama:mathalama@postgres:5432/mathalama?sslmode=disable
ENABLE_DEV_LOGIN: "false"
ports:
- "8080:8080"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 5
telegram-bot:
build:
context: ./telegram-bot
dockerfile: Dockerfile
container_name: mathalama-focus-telegram-bot
depends_on:
backend:
condition: service_healthy
env_file:
- ./telegram-bot/.env
environment:
BACKEND_URL: http://backend:8080
APP_URL: http://localhost:5173
BOT_INTERNAL_API_ADDR: ":8091"
ports:
- "8091:8091"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8091/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# Frontend intentionally runs outside Docker:
# cd frontend && npm install && npm run dev
volumes:
focus_pg_data: