-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (87 loc) · 2.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (87 loc) · 2.86 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
# docker-compose.yml: local dev stack for Panakoes.
#
# Brought up by `make dev-up` (which calls scripts/dev-up.sh). Provides:
# - postgres 16 (auth/billing/ingestion relational data)
# - dynamodb-local (audit log, ingestion records, streaming sessions)
# - localstack (S3, DynamoDB, EventBridge, SNS, SQS for full
# AWS-emulated integration tests; opt-in via
# DEV_LOCALSTACK=1 to keep dev-up fast by default)
#
# All services use named volumes for persistence so data survives a
# `docker compose down` (use `docker compose down -v` to wipe).
#
# Health checks gate `service_healthy` so dependents only start once the
# upstream is ready to accept connections. Localstack is an optional
# profile and does not block the default boot.
services:
postgres:
image: postgres:16-alpine
container_name: panakoes-postgres
restart: unless-stopped
environment:
POSTGRES_USER: panakoes
POSTGRES_PASSWORD: panakoes
POSTGRES_DB: panakoes
ports:
- "5432:5432"
volumes:
- panakoes-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U panakoes -d panakoes"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
dynamodb-local:
image: amazon/dynamodb-local:2.5.2
container_name: panakoes-dynamodb-local
restart: unless-stopped
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-dbPath", "/data"]
user: root
working_dir: /home/dynamodblocal
ports:
- "8000:8000"
volumes:
- panakoes-dynamodb-data:/data
healthcheck:
# DynamoDB-local has no /health endpoint; ListTables returns 200 always
# and is a cheap liveness check. The image has curl but not wget.
test: ["CMD-SHELL", "curl -so /dev/null http://localhost:8000"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
localstack:
image: localstack/localstack:3.8
container_name: panakoes-localstack
restart: unless-stopped
profiles:
- localstack
environment:
SERVICES: s3,dynamodb,events,sns,sqs,secretsmanager,kms,sts,iam,logs
DEBUG: "0"
PERSISTENCE: "1"
DOCKER_HOST: unix:///var/run/docker.sock
ports:
- "4566:4566"
volumes:
- panakoes-localstack-data:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
postgres:
condition: service_healthy
dynamodb-local:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:4566/_localstack/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 15s
volumes:
panakoes-postgres-data:
name: panakoes-postgres-data
panakoes-dynamodb-data:
name: panakoes-dynamodb-data
panakoes-localstack-data:
name: panakoes-localstack-data