-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.multi.yml
More file actions
84 lines (79 loc) · 1.95 KB
/
docker-compose.multi.yml
File metadata and controls
84 lines (79 loc) · 1.95 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
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=game_server_dev
volumes:
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d game_server_dev"]
ports:
- "5432:5432"
networks:
- web
app:
build: .
# Enable this to set custom env values
#env_file:
# - .env
environment:
# Run mix phx.gen.secret
SECRET_KEY_BASE: 1DdaMAX56nUh1tvXniEEuQNsGNvgADndawxrJ3YFZlLXc9EOahC/NFDgowCDUFwb
# Path to server module plugins
GAME_SERVER_PLUGINS_DIR: modules/plugins_examples
DEVICE_AUTH_ENABLED: true
PHX_HOST: localhost
# Disable this in prod
MAILBOX_PREVIEW_ENABLED: true
# Postgres
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: game_server_dev
# Cache
CACHE_MODE: multi
CACHE_L2: redis
CACHE_REDIS_URL: redis://redis:6379/0
volumes:
- ./modules:/app/modules
- ./priv/static/images:/app/priv/static/images
- ./priv/static/assets/css/theme:/app/priv/static/assets/css/theme
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
volumes:
pgdata:
redis_data:
networks:
web:
driver: bridge