From e118e6859ce86938f052d6a10ba7b8e1cba7b9e5 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 01:08:36 -0400 Subject: [PATCH 1/7] chore[hosting]: switch process type back to worker Now that we have a dockerfile, one of our supported hosting platforms will use that file for running the bot, and will ignore the Procfile This means that we can switch the process type back to worker, which is what our other supported hosting platform is expecting. --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 135be655..8faf34e1 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: python -m modmail +worker: python -m modmail From 1b0903ebb286ded084102f94fcfb973d80290032 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 12:31:36 -0400 Subject: [PATCH 2/7] feat[hosting]: switch to heroku.yml and dockerfiles for deploying --- heroku.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 heroku.yml diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 00000000..7b13190d --- /dev/null +++ b/heroku.yml @@ -0,0 +1,3 @@ +build: + docker: + worker: Dockerfile From 8df91eafd873616dd5c2c067d0d2ef38c639de66 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 12:33:08 -0400 Subject: [PATCH 3/7] chore[hosting]: remove procfile and runtime.txt --- Procfile | 1 - runtime.txt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 Procfile delete mode 100644 runtime.txt diff --git a/Procfile b/Procfile deleted file mode 100644 index 8faf34e1..00000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -worker: python -m modmail diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 index 9bff0e00..00000000 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.9.6 From c1058c48a4e6c46b955a2c076de2b1315b9594e3 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 13:02:03 -0400 Subject: [PATCH 4/7] nit[hosting]: set heroku stack to use the container --- app.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 app.json diff --git a/app.json b/app.json new file mode 100644 index 00000000..3b2da009 --- /dev/null +++ b/app.json @@ -0,0 +1,3 @@ +{ + "stack": "container" +} From 3b257cb7e53e042397eac236f1291ceddc3747e7 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 13:34:27 -0400 Subject: [PATCH 5/7] ci: add json checkers to pre-commit configuration --- .pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19bba91e..e0d87314 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,9 +5,12 @@ repos: rev: v4.0.1 hooks: - id: check-merge-conflict + - id: check-json - id: check-toml - id: check-yaml exclude: 'mkdocs.yml' # Exclude all mkdocs.yml as they use tags i.e. `!!!` + - id: pretty-format-json + args: ['--indent=4','--autofix'] - id: end-of-file-fixer - id: no-commit-to-branch args: [--branch=main, --branch=master] From 3c726bef5f4241d04a74ae43a1133831a7d0c5f0 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 13:43:48 -0400 Subject: [PATCH 6/7] chore[hosting]: add env vars to heroku app.json --- app.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app.json b/app.json index 3b2da009..11af2756 100644 --- a/app.json +++ b/app.json @@ -1,3 +1,12 @@ { - "stack": "container" + "env": { + "TOKEN": { + "description": "Discord bot token. This is from https://discord.com/developers/applications", + "required": true + } + }, + "name": "Modmail Bot", + "repository": "https://github.com/discord-modmail/modmail", + "stack": "container", + "website": "https://discord-modmail.readthedocs.io/" } From 0d36e6e0560b22d775d4180d708b84ef487d57e4 Mon Sep 17 00:00:00 2001 From: onerandomusername Date: Thu, 19 Aug 2021 14:15:31 -0400 Subject: [PATCH 7/7] changes: document all docker changes --- docs/changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index ab0ba54c..40f75bb8 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- docker-compose.yml (#13) + - Running the bot after configuring the env vars is now as simple as `docker-compose up` +- Automatic docker image creation: `ghcr.io/discord-modmail/modmail` (#19) +- Dockerfile support for all supported hosting providers. (#58) + ### Changed - Refactored bot creation and bot running (#56) @@ -15,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 handling loop errors, as run() does this automatically. + ## [0.1.0] - 2021-08-13 ### Added