-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
68 lines (64 loc) · 1.7 KB
/
docker-compose.yaml
File metadata and controls
68 lines (64 loc) · 1.7 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
# =============================================================================
# Synapse — Docker Compose
# =============================================================================
#
# Services:
# db — PostgreSQL database (reuses the existing synapse-db image)
# api — Synapse REST API server
#
# Usage:
# docker compose up -d # start everything
# docker compose down # stop everything
# docker compose logs -f api # tail API logs
#
# After startup:
# API: http://localhost:8080
# Swagger UI: http://localhost:8080/docs
# =============================================================================
services:
db:
build:
context: pkg/storage/docker
container_name: synapse-db
environment:
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- synapse-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U synapse -d synapse"]
interval: 2s
timeout: 3s
retries: 15
start_period: 5s
nats:
image: nats:2-alpine
container_name: synapse-nats
command: ["--jetstream", "--store_dir=/data", "--http_port=8222"]
ports:
- "4222:4222"
- "8222:8222"
volumes:
- synapse-natsdata:/data
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8222/healthz"]
interval: 2s
timeout: 3s
retries: 10
start_period: 3s
api:
build:
context: .
dockerfile: Dockerfile
container_name: synapse-api
ports:
- "8080:8080"
depends_on:
db:
condition: service_healthy
nats:
condition: service_healthy
volumes:
synapse-pgdata:
synapse-natsdata: