-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from discord-modmail/setup-docker
Add Docker Setup
- Loading branch information
Showing
6 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,6 @@ logs | |
|
||
# Configuration | ||
*config.toml | ||
|
||
# Custom docker compose override | ||
docker-compose.override.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM python:3.9-slim | ||
|
||
# Set pip to have cleaner logs and no saved cache | ||
ENV PIP_NO_CACHE_DIR=false \ | ||
POETRY_VIRTUALENVS_CREATE=false | ||
|
||
# HACK: Git is required to install a pinned version of discord.py master | ||
# /var/lib/apt/lists is where `apt-get update` downloads are stored, they can be removed | ||
# as they are recreated when package lists are updated and are redundant | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install poetry | ||
RUN pip install -U poetry | ||
|
||
# See https://github.com/python-poetry/poetry/issues/3336 | ||
RUN poetry config experimental.new-installer false | ||
|
||
# Create the working directory | ||
WORKDIR /modmail | ||
|
||
# Copy the source code in last to optimize rebuilding the image | ||
COPY . . | ||
|
||
# Install project dependencies | ||
RUN poetry install --no-dev | ||
|
||
CMD ["python", "-m", "modmail"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file can be used to quickly set up the modmail bot | ||
|
||
version: "3.7" | ||
|
||
x-restart-policy: &restart_policy | ||
restart: unless-stopped | ||
|
||
services: | ||
modmail: | ||
<< : *restart_policy | ||
container_name: modmail | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- .:/modmail | ||
env_file: | ||
- .env | ||
tty: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters