2022-11-07 16:34:43 +01:00
|
|
|
x-environment: &oncall-environment
|
2022-10-24 14:08:40 +01:00
|
|
|
BASE_URL: $DOMAIN
|
|
|
|
|
SECRET_KEY: $SECRET_KEY
|
|
|
|
|
RABBITMQ_USERNAME: "rabbitmq"
|
|
|
|
|
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD
|
|
|
|
|
RABBITMQ_HOST: "rabbitmq"
|
|
|
|
|
RABBITMQ_PORT: "5672"
|
|
|
|
|
RABBITMQ_DEFAULT_VHOST: "/"
|
|
|
|
|
MYSQL_PASSWORD: $MYSQL_PASSWORD
|
|
|
|
|
MYSQL_DB_NAME: oncall_hobby
|
|
|
|
|
MYSQL_USER: ${MYSQL_USER:-root}
|
|
|
|
|
MYSQL_HOST: ${MYSQL_HOST:-mysql}
|
|
|
|
|
MYSQL_PORT: 3306
|
|
|
|
|
REDIS_URI: redis://redis:6379/0
|
|
|
|
|
DJANGO_SETTINGS_MODULE: settings.hobby
|
|
|
|
|
CELERY_WORKER_QUEUE: "default,critical,long,slack,telegram,webhook,retry,celery"
|
|
|
|
|
CELERY_WORKER_CONCURRENCY: "1"
|
|
|
|
|
CELERY_WORKER_MAX_TASKS_PER_CHILD: "100"
|
|
|
|
|
CELERY_WORKER_SHUTDOWN_INTERVAL: "65m"
|
|
|
|
|
CELERY_WORKER_BEAT_ENABLED: "True"
|
2022-11-21 16:26:00 +01:00
|
|
|
GRAFANA_API_URL: http://grafana:3000
|
2022-10-24 14:08:40 +01:00
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
engine:
|
|
|
|
|
image: grafana/oncall
|
|
|
|
|
restart: always
|
|
|
|
|
ports:
|
|
|
|
|
- "8080:8080"
|
2023-08-03 17:50:40 +02:00
|
|
|
command: sh -c "uwsgi --ini uwsgi.ini"
|
2022-10-24 14:08:40 +01:00
|
|
|
environment: *oncall-environment
|
|
|
|
|
depends_on:
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
oncall_db_migration:
|
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
rabbitmq:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
redis:
|
|
|
|
|
condition: service_started
|
|
|
|
|
|
|
|
|
|
celery:
|
|
|
|
|
image: grafana/oncall
|
|
|
|
|
restart: always
|
|
|
|
|
command: sh -c "./celery_with_exporter.sh"
|
|
|
|
|
environment: *oncall-environment
|
|
|
|
|
depends_on:
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
oncall_db_migration:
|
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
rabbitmq:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
redis:
|
|
|
|
|
condition: service_started
|
|
|
|
|
|
|
|
|
|
oncall_db_migration:
|
|
|
|
|
image: grafana/oncall
|
|
|
|
|
command: python manage.py migrate --noinput
|
|
|
|
|
environment: *oncall-environment
|
|
|
|
|
depends_on:
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
rabbitmq:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
|
|
mysql:
|
2023-05-10 13:53:27 -04:00
|
|
|
image: mysql:8.0.32
|
2023-08-03 17:50:40 +02:00
|
|
|
command: >-
|
2023-08-03 08:35:08 +02:00
|
|
|
--default-authentication-plugin=mysql_native_password
|
|
|
|
|
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
2022-10-24 14:08:40 +01:00
|
|
|
restart: always
|
|
|
|
|
expose:
|
|
|
|
|
- 3306
|
|
|
|
|
volumes:
|
|
|
|
|
- dbdata:/var/lib/mysql
|
|
|
|
|
environment:
|
|
|
|
|
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
|
|
|
|
|
MYSQL_DATABASE: oncall_hobby
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
2023-05-10 13:53:27 -04:00
|
|
|
memory: 1000m
|
2022-11-07 16:34:43 +01:00
|
|
|
cpus: "0.5"
|
2022-10-24 14:08:40 +01:00
|
|
|
healthcheck:
|
|
|
|
|
test: "mysql -uroot -p$MYSQL_PASSWORD oncall_hobby -e 'select 1'"
|
|
|
|
|
timeout: 20s
|
|
|
|
|
retries: 10
|
|
|
|
|
|
|
|
|
|
redis:
|
2022-11-07 16:34:43 +01:00
|
|
|
image: redis:7.0.5
|
2022-10-24 14:08:40 +01:00
|
|
|
restart: always
|
|
|
|
|
expose:
|
|
|
|
|
- 6379
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
memory: 100m
|
2022-11-07 16:34:43 +01:00
|
|
|
cpus: "0.1"
|
2022-10-24 14:08:40 +01:00
|
|
|
|
|
|
|
|
rabbitmq:
|
2023-06-29 12:49:00 +02:00
|
|
|
image: "rabbitmq:3.12.0-management"
|
2022-10-24 14:08:40 +01:00
|
|
|
restart: always
|
|
|
|
|
hostname: rabbitmq
|
|
|
|
|
volumes:
|
|
|
|
|
- rabbitmqdata:/var/lib/rabbitmq
|
|
|
|
|
environment:
|
|
|
|
|
RABBITMQ_DEFAULT_USER: "rabbitmq"
|
|
|
|
|
RABBITMQ_DEFAULT_PASS: $RABBITMQ_PASSWORD
|
|
|
|
|
RABBITMQ_DEFAULT_VHOST: "/"
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
memory: 1000m
|
2022-11-07 16:34:43 +01:00
|
|
|
cpus: "0.5"
|
2022-10-24 14:08:40 +01:00
|
|
|
healthcheck:
|
|
|
|
|
test: rabbitmq-diagnostics -q ping
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 30s
|
|
|
|
|
retries: 3
|
|
|
|
|
|
|
|
|
|
mysql_to_create_grafana_db:
|
2023-05-10 13:53:27 -04:00
|
|
|
image: mysql:8.0.32
|
2023-08-03 17:50:40 +02:00
|
|
|
command: >-
|
2023-08-03 08:35:08 +02:00
|
|
|
bash -c "mysql -h ${MYSQL_HOST:-mysql} -uroot -p${MYSQL_PASSWORD:?err}
|
|
|
|
|
-e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
|
2022-10-24 14:08:40 +01:00
|
|
|
depends_on:
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
profiles:
|
|
|
|
|
- with_grafana
|
|
|
|
|
|
|
|
|
|
grafana:
|
2023-05-02 08:19:34 -04:00
|
|
|
image: "grafana/${GRAFANA_IMAGE:-grafana:latest}"
|
2022-10-24 14:08:40 +01:00
|
|
|
restart: always
|
|
|
|
|
ports:
|
|
|
|
|
- "3000:3000"
|
|
|
|
|
environment:
|
|
|
|
|
GF_DATABASE_TYPE: mysql
|
|
|
|
|
GF_DATABASE_HOST: ${MYSQL_HOST:-mysql}
|
|
|
|
|
GF_DATABASE_USER: ${MYSQL_USER:-root}
|
|
|
|
|
GF_DATABASE_PASSWORD: ${MYSQL_PASSWORD:?err}
|
2024-09-05 12:18:07 -06:00
|
|
|
GF_FEATURE_TOGGLES_ENABLE: externalServiceAccounts
|
2022-10-24 14:08:40 +01:00
|
|
|
GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin}
|
|
|
|
|
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
|
|
|
|
|
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: grafana-oncall-app
|
|
|
|
|
GF_INSTALL_PLUGINS: grafana-oncall-app
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
memory: 500m
|
2022-11-07 16:34:43 +01:00
|
|
|
cpus: "0.5"
|
2022-10-24 14:08:40 +01:00
|
|
|
depends_on:
|
|
|
|
|
mysql_to_create_grafana_db:
|
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
profiles:
|
|
|
|
|
- with_grafana
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
dbdata:
|
|
|
|
|
rabbitmqdata:
|