{"id":13619971,"url":"https://github.com/galexrt/container-healthchecks","last_synced_at":"2025-04-09T19:19:39.219Z","repository":{"id":38536934,"uuid":"70133538","full_name":"galexrt/container-healthchecks","owner":"galexrt","description":"Simple to use Container Image for https://github.com/healthchecks/healthchecks.","archived":false,"fork":false,"pushed_at":"2025-04-03T12:49:59.000Z","size":198,"stargazers_count":64,"open_issues_count":3,"forks_count":19,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T19:19:34.991Z","etag":null,"topics":["container-image","hacktoberfest","healthchecks"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galexrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-06T07:46:50.000Z","updated_at":"2025-02-20T18:30:04.000Z","dependencies_parsed_at":"2024-03-04T20:45:31.347Z","dependency_job_id":"5eac0533-482c-44fd-aaf1-a806ca25eab2","html_url":"https://github.com/galexrt/container-healthchecks","commit_stats":null,"previous_names":[],"tags_count":259,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fcontainer-healthchecks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fcontainer-healthchecks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fcontainer-healthchecks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fcontainer-healthchecks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galexrt","download_url":"https://codeload.github.com/galexrt/container-healthchecks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094991,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container-image","hacktoberfest","healthchecks"],"created_at":"2024-08-01T21:00:50.679Z","updated_at":"2025-04-09T19:19:39.193Z","avatar_url":"https://github.com/galexrt.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# container-healthchecks\n\nSimple to use Container Image for [github.com/healthchecks/healthchecks](https://github.com/healthchecks/healthchecks).\n\nContainer Image available from:\n\n* [Quay.io](https://quay.io/repository/galexrt/healthchecks)\n* [GHCR.io](https://github.com/users/galexrt/packages/container/package/healthchecks)\n* [**DEPRECATED** Docker Hub](https://hub.docker.com/r/galexrt/healthchecks)\n  * Docker Hub will not receive any new tags starting with Healthchecks version `v1.22.0`!\n\nContainer Image Tags:\n\n* `main` - Latest build of the `main` branch.\n* `vx.y.z` - Latest build of the application (updated in-sync with the date container image tags).\n* `vx.y.z-YYYYmmdd-HHMMSS-NNN` - Latest build of the application with date of the build.\n\n## Healthchecks Version\n\nCurrently Healthchecks `v2.10` version is installed in the image.\n\n## Running The Container Image\n\n**NOTE** By default Healthchecks uses a SQLite database, located at `/data/hc.sqlite`.\n\nTo configure [healthchecks](https://github.com/healthchecks/healthchecks) server, you\njust add the environment variables as shown in the [`settings.py` file of the healthchecks Project](https://github.com/healthchecks/healthchecks/blob/master/hc/settings.py).\n\n```bash\ndocker run \\\n    --detach \\\n    --name=healthchecks \\\n    --publish 80:8000 \\\n    --env 'DB_NAME=/data/hc.sqlite' \\\n    --env 'SECRET_KEY=YOUR_SECRET_KEY' \\\n    --env 'PING_EMAIL_DOMAIN=example.com' \\\n    --env 'SITE_ROOT=http://example.com' \\\n    --env 'EMAIL_HOST=smtp.example.com' \\\n    --env 'EMAIL_PORT=25' \\\n    --env 'EMAIL_USE_TLS=True' \\\n    --env 'EMAIL_HOST_USER=user@example.com' \\\n    --env 'EMAIL_HOST_PASSWORD=YOUR_PASSWORD' \\\n    --env 'ALLOWED_HOSTS=localhost,*' \\\n    --env 'CONTAINER_PRUNE_INTERVAL=600'\n    --volume /opt/docker/healthchecks/data:/data \\\n    quay.io/galexrt/healthchecks:main\n```\n\n**WARNING** The default uses a SQLite database, check [Database configuration](#database-configuration) section for more information.\nIf you are not using SQLite, you can remove the `--volume ...:...` flag, unless you need it otherwise.\n\n**NOTE** If you want to use the [Healthchecks SMTP Listener Service](https://github.com/healthchecks/healthchecks#receiving-emails), add `--publish 2525:2525` flag (the port inside the container `2525/tcp` cannot be changed).\n\nThe port of Healthchecks in the container is `8000/tcp` it will be exposed to `80/tcp` in the example command.\n\nA HTTPS Proxy is required for healthchecks to be reachable.\nThis is caused by the CSRF verification failing if HTTPS is not used.\nThe HTTPS Proxy must pass through/create `X-FORWARDED-*` headers.\nAn example for a simple HTTPS proxy for Docker can be found here: [GitHub - jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy).\n\n### Running In Production\n\nPlease checkout the official [healthchecks/healthchecks Project Running in Production guide](https://github.com/healthchecks/healthchecks#running-in-production) for information on a secure configuration.\n\n### Database Configuration\n\n**The default setting uses SQLite** unless configured otherwise.\n\n**WARNING** For SQLite the `DB_NAME` must be set to this `/data/hc.sqlite`. A volume should be mounted to `/data` (`docker run [...] --volume /opt/docker/healthchecks/data:/data [...] galexrt/healthchecks:latest`) inside the container as otherwise the SQLite database is lost on container deletion.\n\n#### Want to use MySQL or Postgres?\n\nThe following environment variables can be used to configure the database connection:\n\n| Variable      | Description                                                   |\n| ------------- | ------------------------------------------------------------- |\n| `DB`          | Can be `postgres`, `mysql`, `sqlite3` (defaults to `sqlite3`) |\n| `DB_HOST`     | Database host address                                         |\n| `DB_PORT`     | Database host port                                            |\n| `DB_NAME`     | Database name                                                 |\n| `DB_USER`     | Database user                                                 |\n| `DB_PASSWORD` | Database user password                                        |\n\n(See https://github.com/healthchecks/healthchecks/blob/master/hc/settings.py#L100-L142)\n\n[The `docker-compose.yml` shows an example of the environment variables for using a MySQL database server.](docker-compose.yml)\n\n### Email Configuration\n\nThe following environment variables can be used to configure the email notifications (uses SMTP):\n\n| Variable              | Description                    |\n| --------------------- | ------------------------------ |\n| `EMAIL_HOST`          | SMTP host address              |\n| `EMAIL_PORT`          | SMTP host port                 |\n| `EMAIL_USE_TLS`       | If tls should be used for SMTP |\n| `EMAIL_USE_SSL`       | If ssl should be used for SMTP |\n| `EMAIL_HOST_USER`     | SMTP user                      |\n| `EMAIL_HOST_PASSWORD` | SMTP user password             |\n\n(See https://github.com/healthchecks/healthchecks/blob/master/hc/settings.py#L173-L179)\n\n### Environment Configuration Variables\n\nThe following environment variables can be used to configure some \"special\" values for Healthchecks:\n\n| Variable        | Description                                                                                                                                                                |\n| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `ALLOWED_HOSTS` | Comma separated list of the allowed hosts, should be the hostnames the healthchecks container is reachable as for the Docker healthcheck to work, must include `localhost` |\n| `SECRET_KEY`    | Set to a random secret value (if unset or changed sessions are invalidated)                                                                                                |\n| `CONTAINER_PRUNE_INTERVAL`| Time in seconds between executions of `prunepings`, `prunenotifications`, `pruneflips` and `prunetokenbucket` (default: 600 seconds)                                                |\n\n### Other Configuration Variables\n\nCheckout the [`healthchecks/healthchecks settings.py`](https://github.com/healthchecks/healthchecks/blob/master/hc/settings.py), if you want to set one of these variable as a setting you simply set it as an environment variable on the container.\n\nExample for variable `SLACK_CLIENT_ID`, you would add environment variable `SLACK_CLIENT_ID` for the container.\n\n### Run `python manage.py` inside the container\n\nYou need the container name or id of the healthchecks instance. You can get it by running `docker ps` and searching for the container running healthchecks.\n\n```bash\ndocker exec -it CONTAINER_NAME /entrypoint.sh app:managepy YOUR_MANAGE_PY_FLAGS_COMMAND\n```\n\n### Activating Telegram Bot and other Bots\n\nUse the command from the last section and for `YOUR_MANAGE_PY_FLAGS_COMMAND` use this:\n\n```bash\nsettelegramwebhook\n```\n\n**Example**:\n\n```bash\ndocker exec -it CONTAINER_NAME /entrypoint.sh app:managepy settelegramwebhook\n```\n\nFor this to work, you need to have set the following variables:\n\n* `SITE_NAME`\n* `TELEGRAM_TOKEN`\n\n#### Other Bots\n\nUnless not specified otherwise in documentation of the [healthchecks/healthchecks\nGitHub](https://github.com/healthchecks/healthchecks) project, you just need to set the environment variables on\nthe Docker container and you are done (after a restart).\n\n### Turn Off Debug Mode / Run In Production Mode\n\nAdd the env var `DEBUG: \"false\"` to your Docker container.\n\n```bash\ndocker run \\\n[...]\n    --env 'DEBUG=false' \\\n[...]\n```\n\n### Create Superuser in Healthchecks\n\nYou need the container name or id of the healthchecks container instance. You can get it by running `docker ps` and searching for the container running healthchecks.\n\n```bash\ndocker exec -it CONTAINER_NAME python3 /healthchecks/manage.py createsuperuser\n```\n\nFollow the assistant that will show up to create a healthchecks superuser.\n\n### docker-compose\n\n[Example `docker-compose.yml`](docker-compose.yml):\n\n```yaml\nversion: '3'\nservices:\n  hc:\n    image: quay.io/galexrt/healthchecks:main\n    restart: always\n    ports:\n      - \"8000:8000\"\n    volumes:\n      - SQLite:/data\n    environment:\n      # DB_NAME must be set like this for the /data volume to be used\n      # otherwise when using SQLite for the database, all data is **lost**\n      # on container deletion / recreation.\n      DB_NAME: \"/data/hc.sqlite\"\n      SECRET_KEY: \"blablabla123\"\n      ALLOWED_HOSTS: 'localhost,healthchecks.example.com'\n      DEBUG: \"False\"\n      DEFAULT_FROM_EMAIL: \"noreply@hc.example.com\"\n      USE_PAYMENTS: \"False\"\n      REGISTRATION_OPEN: \"False\"\n      EMAIL_HOST: \"\"\n      EMAIL_PORT: \"587\"\n      EMAIL_HOST_USER: \"\"\n      EMAIL_HOST_PASSWORD: \"\"\n      EMAIL_USE_TLS: \"True\"\n      SITE_ROOT: \"https://hc.example.com\"\n      SITE_NAME: \"Mychecks\"\n      MASTER_BADGE_LABEL: \"Mychecks\"\n      PING_ENDPOINT: \"https://hc.example.com/ping/\"\n      PING_EMAIL_DOMAIN: \"hc.example.com\"\n      TWILIO_ACCOUNT: \"None\"\n      TWILIO_AUTH: \"None\"\n      TWILIO_FROM: \"None\"\n      PD_VENDOR_KEY: \"None\"\n      TRELLO_APP_KEY: \"None\"\n      CONTAINER_PRUNE_INTERVAL: 600\n# Remove when not using SQLite\nvolumes:\n  SQLite:\n```\n\n## Release\n\n1. Run `make release` locally.\n2. Wait for completion.\n3. Container images will be pushed automatically to the registries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalexrt%2Fcontainer-healthchecks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalexrt%2Fcontainer-healthchecks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalexrt%2Fcontainer-healthchecks/lists"}