-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (77 loc) · 2.67 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (77 loc) · 2.67 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
services:
postgres:
image: postgres:16-alpine
env_file:
- path: .env
required: false
environment:
POSTGRES_USER: ${POSTGRES_USER:-astrotrack}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-astrotrack}
POSTGRES_DB: ${POSTGRES_DB:-astrotrack}
ports:
- "5432:5432"
volumes:
- astrotrack-pg:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-astrotrack}"]
interval: 10s
timeout: 5s
retries: 10
# Reserved for future position caching; uncomment when caching lands.
# redis:
# image: redis:7-alpine
# ports:
# - "6379:6379"
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# interval: 10s
# timeout: 3s
# retries: 5
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- path: .env
required: false
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
# To enable telemetry, run: docker compose --profile observability up
# and set OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 in your .env file.
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-}
OTEL_SERVICE_NAME: astrotrack-api
OTEL_RESOURCE_ATTRIBUTES: service.namespace=astrotrack,deployment.environment=local
AstroTrack__Cors__AllowedOrigins__0: ${AstroTrack__Cors__AllowedOrigins__0:-http://localhost:8080}
AstroTrack__Cors__AllowedOrigins__1: ${AstroTrack__Cors__AllowedOrigins__1:-http://localhost:5173}
ConnectionStrings__Postgres: ${ConnectionStrings__Postgres:-Host=postgres;Database=astrotrack;Username=astrotrack;Password=astrotrack}
# Reserved for future position caching; uncomment when caching lands.
# ConnectionStrings__Redis: redis:6379
depends_on:
postgres:
condition: service_healthy
# Reserved for future position caching; uncomment when caching lands.
# redis:
# condition: service_healthy
ports:
- "5080:8080"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
depends_on:
- backend
ports:
- "8080:80"
# Optional observability stack — only started when you run:
# docker compose --profile observability up
# Set OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 in your .env to enable telemetry export.
otel-collector:
profiles: ["observability"]
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otelcol-contrib/config.yaml"]
volumes:
- ./deploy/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro
ports:
- "4317:4317"
volumes:
astrotrack-pg: