/
docker-compose-prod.yaml
91 lines (85 loc) · 2.33 KB
/
docker-compose-prod.yaml
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
version: "3.8"
name: "${APP_NAME:-electric}"
configs:
postgres_config:
file: "./postgres/postgres.conf"
volumes:
pg_data:
caddy_data: {}
networks:
caddy:
external: true
services:
postgres:
image: "${POSTGRESQL_IMAGE:-postgres:14-alpine}"
environment:
POSTGRES_DB: ${APP_NAME:-electric}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pg_password
command:
- -c
- config_file=/etc/postgresql.conf
configs:
- source: postgres_config
target: /etc/postgresql.conf
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- caddy
ports:
- 5432
volumes:
- pg_data:/var/lib/postgresql/data
electric:
image: "${ELECTRIC_IMAGE:-electricsql/electric:latest}"
init: true
environment:
DATABASE_URL: postgresql://postgres:pg_password@postgres:5432/${APP_NAME:-electric}
PG_PROXY_PASSWORD: proxy_password
LOGICAL_PUBLISHER_HOST: electric
AUTH_MODE: insecure
ports:
- ${ELECTRIC_PORT:-5133}:5133
- ${ELECTRIC_PROXY_PORT:-65432}:65432
networks:
- caddy
labels:
caddy: "${ELECTRIC_PRODUCTION_DOMAIN:-example.com}"
caddy.reverse_proxy: "{{upstreams http 5133}}"
depends_on:
- postgres
otel-collector:
image: otel/opentelemetry-collector-contrib
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
networks:
- caddy
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension
labels:
caddy: "${ELECTRIC_PRODUCTION_DOMAIN:-example.com}"
caddy.reverse_proxy: /v1/traces "{{upstreams http 4318}}"
environment:
HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
HONEYCOMB_DATASET: ${HONEYCOMB_DATASET}
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
restart: unless-stopped