-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 1.35 KB
/
docker-compose.yml
File metadata and controls
60 lines (56 loc) · 1.35 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
# docker-compose.yml - Development setup with separate containers
#
# For simple all-in-one deployment, use docker-compose.bundle.yml instead.
#
# Usage:
# docker compose up -d
# docker compose down -v # wipe and reset
services:
api:
build: .
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgres://matric:matric@db:5432/matric
- RUST_LOG=info
- HOST=0.0.0.0
- PORT=3000
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
build:
context: .
dockerfile: build/Dockerfile.testdb
environment:
- POSTGRES_USER=matric
- POSTGRES_PASSWORD=matric
- POSTGRES_DB=matric
volumes:
- pgdata:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U matric"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Job worker (optional, runs in separate container)
worker:
build: .
command: ["/app/matric-api", "--worker-only"]
environment:
- DATABASE_URL=postgres://matric:matric@db:5432/matric
- RUST_LOG=info
- WORKER_MODE=true
depends_on:
db:
condition: service_healthy
restart: unless-stopped
profiles:
- with-worker
volumes:
pgdata: