services: healthchecks: image: healthchecks/healthchecks:v4.4 restart: unless-stopped environment: DB: postgres DB_HOST: ${DATABASE_HOST:?reload New project to link a Postgres database, or send link_databases with env_prefix DATABASE} DB_PORT: ${DATABASE_PORT:?reload New project to link a Postgres database, or send link_databases with env_prefix DATABASE} DB_NAME: ${DATABASE_NAME:?reload New project to link a Postgres database, or send link_databases with env_prefix DATABASE} DB_USER: ${DATABASE_USER:?reload New project to link a Postgres database, or send link_databases with env_prefix DATABASE} DB_PASSWORD: ${DATABASE_PASSWORD:?reload New project to link a Postgres database, or send link_databases with env_prefix DATABASE} SECRET_KEY: ${SECRET_KEY} SITE_ROOT: ${URL} PING_ENDPOINT: ${URL}/ping/ SITE_NAME: Healthchecks DEBUG: "False" # Only the account below signs in: nobody signs up by the address. REGISTRATION_OPEN: "False" ADMIN_EMAIL: ${ADMIN_EMAIL} ADMIN_PASSWORD: ${ADMIN_PASSWORD} # The mail provider picked in New project, by STARTTLS on its port. With none, the host is # empty and Healthchecks sends no mail; the port then stays a number, which it requires. EMAIL_HOST: ${SMTP_HOST} EMAIL_PORT: ${SMTP_PORT:-587} EMAIL_USE_TLS: "True" EMAIL_USE_SSL: "False" EMAIL_HOST_USER: ${SMTP_USER} EMAIL_HOST_PASSWORD: ${SMTP_PASSWORD} DEFAULT_FROM_EMAIL: ${SMTP_FROM:-healthchecks@example.org} # The tables and the account are made before the server answers, the account the first time # only; a database that does not answer yet fails the start, and the container starts again. command: - sh - -c - | set -e ./manage.py migrate ./manage.py shell -c ' import os, sys from django.contrib.auth.models import User sys.exit(0 if User.objects.filter(email=os.environ["ADMIN_EMAIL"].lower()).exists() else 1) ' || ./manage.py createsuperuser --email "$$ADMIN_EMAIL" --password "$$ADMIN_PASSWORD" exec uwsgi /opt/healthchecks/docker/uwsgi.ini