-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
59 lines (56 loc) · 1.99 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
59 lines (56 loc) · 1.99 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
services:
db:
image: postgres:18
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
# Volume nomeado para não perder os dados ao descer o banco.
# No Postgres 18+ o mount vai em /var/lib/postgresql (os dados ficam
# numa subpasta versionada), e não mais em /var/lib/postgresql/data.
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 10
# Serviço da aplicação (perfil opcional: `docker compose --profile app up`).
# No dia a dia de desenvolvimento usa-se `cargo run` contra o db acima; este
# serviço builda a imagem de produção e sobe o stack completo — as migrações
# rodam sozinhas no boot.
app:
build: .
profiles: ["app"]
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
ADMIN_SECRET_KEY: ${ADMIN_SECRET_KEY:-dev-admin-secret-change-me}
JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret-change-me-with-a-long-random-value}
LOG_FORMAT: json
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:3000/readyz"]
interval: 10s
timeout: 3s
retries: 5
# Coletor OTLP para ver localmente o que `OTEL_EXPORTER_OTLP_ENDPOINT` faz o
# wallet exportar (perfil opcional: `docker compose --profile observability
# up`). Só imprime o que recebe (`docker compose logs -f otel-collector`) —
# não é um backend de observabilidade de verdade, é uma sonda de
# verificação. Aponte o wallet para `http://localhost:4318`.
otel-collector:
image: otel/opentelemetry-collector:latest
profiles: ["observability"]
command: ["--config=/etc/otelcol/config.yaml"]
volumes:
- ./docker/otel-collector/config.yaml:/etc/otelcol/config.yaml
ports:
- "4318:4318"
volumes:
pgdata: