From d9d3f02fda823959f3a3e2de3f4f703083ca57ac Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Thu, 12 Jan 2023 16:31:58 +0100 Subject: [PATCH] feat: Add Dockerfile for development and deployment --- DEVELOPMENT.md | 17 +++++++++++++++++ Dockerfile | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 DEVELOPMENT.md create mode 100644 Dockerfile diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..5556f57 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,17 @@ +# Development Guide + +## Docker + +In order to have a common development environment, its nice to use docker. Its quite easy. To build a new image, simply run + +`docker build . -t mastodon_blocklist_deploy` + +Now you can execute any commands using + +`docker run --rm mastodon_blocklist_deploy --help` + +If you want to avoid building new containers for each change, simply mount your code into the container using + +`docker run --rm -v $(pwd):/app mastodon_blocklist_deploy` + +Please be aware that changes to the package itself require a rebuild anyways. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0cccbfc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.11-slim + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +COPY pyproject.toml poetry.lock README.md /app/ +COPY mastodon_blocklist_deploy /app/mastodon_blocklist_deploy +WORKDIR /app + +ENTRYPOINT ["mastodon_blocklist_deploy"] + +RUN pip install -e .