Repository navigation
Expand file tree
/
Copy pathcompose.dev.yaml
More file actions
146 lines (137 loc) · 4.08 KB
/
Copy pathcompose.dev.yaml
File metadata and controls
146 lines (137 loc) · 4.08 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Local dev/testing stack for Clave.
#
# docker compose -f compose.dev.yaml up -d
#
# Brings up Postgres, RabbitMQ, Mailpit (catch-all SMTP), the Clave backend,
# and the emailer worker.
# The backend reads secrets from your .env file (see README). The few
# vars below override host/port so the containers can find each other.
name: clave-dev
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: clave
POSTGRES_DB: clave
# No password locally — matches sslmode=disable in DATABASE_URL.
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- "54321:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U clave -d clave"]
interval: 5s
timeout: 3s
retries: 10
# Fake SMTP server. Catches every mail, nothing leaves your machine.
# Web inbox: http://localhost:8025
mailpit:
image: axllent/mailpit:latest
ports:
- "1025:1025" # SMTP
- "8025:8025" # web UI
environment:
MP_SMTP_AUTH_ACCEPT_ANY: "true"
MP_SMTP_AUTH_ALLOW_INSECURE: "true"
# OpenTelemetry collector — receives OTLP, exports to Prometheus.
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4318:4318"
# RabbitMQ — message broker for emailer.
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "5672:5672" # AMQP
- "15672:15672" # management UI
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics check_port_connectivity"]
interval: 5s
timeout: 3s
retries: 10
# Prometheus — scrapes the collector, built-in web UI at http://localhost:9090
prometheus:
image: prom/prometheus:latest
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.time=2h"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- .env
environment:
# Talk to the sibling containers, not localhost.
DATABASE_URL: "postgres://clave@postgres:5432/clave?sslmode=disable"
SMTP_HOST: mailpit
SMTP_PORT: "1025"
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
RUN_MIGRATIONS: "true"
DEV: "true"
# Set to "true" to exercise the real emailed 2FA code (read it in Mailpit).
DEV_FORCE_2FA: "false"
PORT: "8000"
PUBLIC_APP_URL: "http://backend:8000"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4318"
LICENSE_JWT_PRIVATE_KEY_FILE: "/run/secrets/license-jwt-private.pem"
volumes:
- "${LICENSE_JWT_PRIVATE_KEY_FILE:?set LICENSE_JWT_PRIVATE_KEY_FILE in .env}:/run/secrets/license-jwt-private.pem:ro"
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
mailpit:
condition: service_started
rabbitmq:
condition: service_healthy
emailer:
build:
context: ./emailer
environment:
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
SMTP_URL: "smtp://mailpit:1025"
EMAIL_FROM: "Clave <no-reply@clave.dev>"
depends_on:
mailpit:
condition: service_started
rabbitmq:
condition: service_healthy
deltaworker:
build:
context: ./backend
dockerfile: Dockerfile
command: ["/deltaworker"]
env_file:
- .env
environment:
API_URL: "http://backend:8000"
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
DELTA_MAX_ARTIFACT_BYTES: "67108864"
DELTA_MEMORY_BUDGET_BYTES: "1342177280"
mem_limit: 1536m
depends_on:
backend:
condition: service_started
rabbitmq:
condition: service_healthy
minio:
image: minio/minio
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: password123
volumes:
pgdata: