-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (69 loc) · 1.77 KB
/
docker-compose.yml
File metadata and controls
74 lines (69 loc) · 1.77 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
services:
# Postgres Database
postgres:
image: postgres:16-alpine
restart: unless-stopped
container_name: uniqcast-db
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
# NATS Server
nats:
image: nats:2.10-alpine
container_name: nats-server
ports:
- "4222:4222"
- "8222:8222"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "4222"]
interval: 5s
timeout: 2s
retries: 5
# Node.js API
api:
build:
context: ./api
dockerfile: Dockerfile
container_name: uniqcast-node-api
command: >
sh -c "pnpm prisma migrate deploy && pnpm run dev"
ports:
- "${HOST_PORT:-3000}:3000"
environment:
PORT: 3000
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=public"
NATS_URL: "nats://nats:4222"
volumes:
- ./api/src:/app/src
- ./api/prisma:/app/prisma
- ./shared:/shared
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
restart: unless-stopped
processing-service:
build: ./processing-service
container_name: processing-service
environment:
- NATS_URL=nats://nats:4222
- OUTPUT_DIR=/shared/output
volumes:
- ./shared:/shared
depends_on:
nats:
condition: service_healthy
restart: unless-stopped
volumes:
postgres-data: