-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (66 loc) · 2.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
70 lines (66 loc) · 2.19 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
services:
postgres:
image: postgres:16-alpine
command: ["postgres", "-c", "max_prepared_transactions=64"]
env_file: .env
environment:
POSTGRES_DB: baseline
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 5s
timeout: 3s
retries: 5
db-migrator:
build:
context: .
dockerfile: Dockerfile.migrator
env_file: .env
environment:
ASPNETCORE_ENVIRONMENT: "Development"
ConnectionStrings__BaselineDatabase: "Host=postgres;Port=5432;Database=baseline;Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}"
Modules__Identity__SeededAdmin__Password: "${SEEDED_ADMIN_PASSWORD}"
depends_on:
postgres:
condition: service_healthy
otel-collector:
image: otel/opentelemetry-collector-contrib:0.112.0
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./docker/otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "13133:13133" # health
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:13133/"]
interval: 10s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
env_file: .env
environment:
ASPNETCORE_ENVIRONMENT: "Development"
ConnectionStrings__BaselineDatabase: "Host=postgres;Port=5432;Database=baseline;Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}"
Modules__Identity__SeededAdmin__Password: "${SEEDED_ADMIN_PASSWORD}"
Modules__Identity__SeededMachine__ApiKey: "${SEEDED_MACHINE_API_KEY}"
Modules__Identity__SeededMachine__Roles__0: "Machine"
OpenTelemetry__OtlpEndpoint: "http://otel-collector:4317"
OpenTelemetry__ServiceName: "dotnet-modulith-baseline-api"
depends_on:
db-migrator:
condition: service_completed_successfully
otel-collector:
condition: service_healthy
volumes:
pgdata: