-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathdocker-compose-common-components.yaml
118 lines (118 loc) · 3.77 KB
/
docker-compose-common-components.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
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
services:
# These containers are created only once regardless of the number of game servers
# that you run inside of CRCON
redis:
image: ${REDIS_IMAGE}
command: redis-server /usr/local/etc/redis/redis.conf
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 15s
timeout: 30s
retries: 5
volumes:
- ./redis_data:/data
- ./config:/usr/local/etc/redis
networks:
- common
postgres:
image: ${POSTGRES_IMAGE}
environment:
# If a password is not defined this container will fail to create
POSTGRES_PASSWORD: ${HLL_DB_PASSWORD}
POSTGRES_USER: ${HLL_DB_USER}
POSTGRES_DB: ${HLL_DB_NAME}
PGDATA: /data
HLL_DB_NAME: ${HLL_DB_NAME}
HLL_DB_USER: ${HLL_DB_USER}
restart: always
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${HLL_DB_USER}", "-d", "${HLL_DB_NAME}" ]
interval: 15s
timeout: 30s
retries: 5
start_period: 80s
volumes:
- ./db_data:/data
networks:
- common
# This container is used for things that should only run once regardless of
# the number of game servers used, for instance database migrations
maintenance:
build:
context: .
dockerfile: Dockerfile
image: ${BACKEND_DOCKER_REPOSITORY}:${TAGGED_VERSION}
environment:
HLL_MAINTENANCE_CONTAINER: true
HLL_DB_USER: ${HLL_DB_USER}
HLL_DB_PASSWORD: ${HLL_DB_PASSWORD}
HLL_DB_NAME: ${HLL_DB_NAME}
HLL_DB_HOST: ${HLL_DB_HOST}
HLL_DB_HOST_PORT: ${HLL_DB_HOST_PORT}
HLL_DB_URL: postgresql://${HLL_DB_USER}:${HLL_DB_PASSWORD}@${HLL_DB_HOST}:${HLL_DB_HOST_PORT}/${HLL_DB_NAME}
HLL_REDIS_URL: redis://${HLL_REDIS_HOST}:${HLL_REDIS_HOST_PORT}/${HLL_REDIS_DB}
command: maintenance
restart: always
healthcheck:
test: [ "CMD-SHELL", "test -f /code/rconweb/maintenance-container-healthy" ]
start_period: 30s
interval: 15s
timeout: 30s
retries: 5
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./logs:/logs/
networks:
- common
# This is used to handle webhooks to discord (and other services in the future)
webhook_service:
build:
context: .
dockerfile: Dockerfile
image: ${BACKEND_DOCKER_REPOSITORY}:${TAGGED_VERSION}
environment:
HLL_WH_SERVICE_CONTAINER: true
LOGGING_LEVEL: "INFO"
LOGGING_PATH: /logs/
CONFIG_DIR: /config/
HLL_REDIS_HOST: ${HLL_REDIS_HOST}
HLL_REDIS_PORT: ${HLL_REDIS_HOST_PORT}
HLL_DB_USER: ${HLL_DB_USER}
HLL_DB_PASSWORD: ${HLL_DB_PASSWORD}
HLL_DB_NAME: ${HLL_DB_NAME}
HLL_DB_HOST: ${HLL_DB_HOST}
HLL_DB_HOST_PORT: ${HLL_DB_HOST_PORT}
HLL_DB_URL: postgresql://${HLL_DB_USER}:${HLL_DB_PASSWORD}@${HLL_DB_HOST}:${HLL_DB_HOST_PORT}/${HLL_DB_NAME}
# The local rate window limit parameters
HLL_WH_SERVICE_RL_RESET_SECS: ${HLL_WH_SERVICE_RL_RESET_SECS}
HLL_WH_SERVICE_RL_REQUESTS_PER: ${HLL_WH_SERVICE_RL_REQUESTS_PER}
HLL_WH_SERVICE_RL_TIME_WINDOW: ${HLL_WH_SERVICE_RL_TIME_WINDOW}
HLL_WH_MAX_QUEUE_LENGTH: ${HLL_WH_MAX_QUEUE_LENGTH}
HLL_WH_LOOP_SLEEP_TIME: ${HLL_WH_LOOP_SLEEP_TIME}
command: webhook_service
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "if [ -e /code/webhook-service-healthy ]; then echo 0; else echo 1; fi" ]
start_period: 30s
interval: 15s
timeout: 30s
retries: 5
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- ./logs:/logs/
networks:
- common
# This is not a CPU intensive container; but
deploy:
resources:
limits:
cpus: '1.0'