-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.multi.yml
More file actions
136 lines (129 loc) · 4.01 KB
/
Copy pathdocker-compose.multi.yml
File metadata and controls
136 lines (129 loc) · 4.01 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
services:
redis:
image: redis:7
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
networks:
- web
db:
image: postgres:18
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=gamend_dev
volumes:
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d gamend_dev"]
ports:
- "5432:5432"
networks:
- web
app:
build: .
# Enable this to set custom env values
#env_file:
# - .env
environment:
# Run mix phx.gen.secret
GAMEND_AUTH_SECRET_KEY_BASE: 1DdaMAX56nUh1tvXniEEuQNsGNvgADndawxrJ3YFZlLXc9EOahC/NFDgowCDUFwb
# Path to server module plugins
GAMEND_CONTENT_PLUGINS_DIR: modules/plugins_examples
GAMEND_AUTH_DEVICE_AUTH_ENABLED: true
GAMEND_HTTP_HOST: localhost
# Disable this in prod
GAMEND_FEATURES_MAILBOX_PREVIEW: true
# Postgres
GAMEND_DB_POSTGRES_HOST: db
GAMEND_DB_POSTGRES_PORT: 5432
GAMEND_DB_POSTGRES_USER: postgres
GAMEND_DB_POSTGRES_PASSWORD: postgres
GAMEND_DB_POSTGRES_DB: gamend_dev
# `off` is gamend's default -- stated here because durability should be
# visible in a deploy file rather than inherited. It commits without
# waiting for the WAL fsync (+71% on write throughput, 3,096/s ->
# 7,448/s on the load-test harness) and exposes up to ~600ms of commits
# to an OS crash. Nothing is corrupted -- this is not `fsync = off` --
# a few recent writes are simply not there. Payments override it per
# transaction (Gamend.Repo.durable_transaction/2). Set "on" for
# PostgreSQL's durable default.
GAMEND_DB_POSTGRES_SYNCHRONOUS_COMMIT: "off"
# Cache
GAMEND_CACHE_MODE: multi
GAMEND_CACHE_L2: redis
GAMEND_CACHE_REDIS_URL: redis://redis:6379/0
# Shared rate limiting across app instances
GAMEND_RATELIMIT_BACKEND: redis
# ── HTTPS (uncomment to enable) ──
# GAMEND_TLS_CERTFILE: /etc/letsencrypt/live/${GAMEND_HTTP_HOST:-localhost}/fullchain.pem
# GAMEND_TLS_KEYFILE: /etc/letsencrypt/live/${GAMEND_HTTP_HOST:-localhost}/privkey.pem
# GAMEND_TLS_FORCE: "true"
# GAMEND_TLS_ACME_WEBROOT: /var/www/acme
# ── GeoIP (country lookup from IP) ──
GAMEND_CONTENT_GEOIP_DB_PATH: /app/data/GeoLite2-Country.mmdb
volumes:
- ./modules:/app/modules
- ./priv/static/images:/app/priv/static/images
- ./priv/static/theme.css:/app/priv/static/theme.css
- ./data:/app/data:ro
# Uncomment for HTTPS — mount Let's Encrypt certs and ACME webroot
# - ./certbot/conf:/etc/letsencrypt:ro
# - ./certbot/www:/var/www/acme:ro
depends_on:
- db
- redis
networks:
- web
# NOTE: we don't map host ports directly here so we can safely scale multiple replicas.
# Expose the internal port so the nginx proxy can talk to the instances.
expose:
- "4000"
nginx:
image: nginx:stable-alpine
ports:
- "4000:80" # Expose to host at port 4000
depends_on:
- app
volumes:
- ./nginx/proxy.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- web
# ── Observability (Prometheus + Grafana) ──
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
depends_on:
- app
networks:
- web
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
networks:
- web
volumes:
pgdata:
redis_data:
prometheus_data:
grafana_data:
networks:
web:
driver: bridge