aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-10-03 11:12:42 +0100
committerGravatar Chris Lovering <[email protected]>2023-10-03 11:12:42 +0100
commitc7a8fafff8737afbb9c9fe59ad5bf5b3400dde8f (patch)
treeb9a0bdda0037e028881769003e4600b50b56469b /examples
parentUse 3.12 stable over rc version (diff)
Add example Docker file and docker compose files, and suggested usages
Diffstat (limited to 'examples')
-rw-r--r--examples/Dockerfile.example12
-rw-r--r--examples/docker-compse.example.yaml13
2 files changed, 25 insertions, 0 deletions
diff --git a/examples/Dockerfile.example b/examples/Dockerfile.example
new file mode 100644
index 0000000..a80d23d
--- /dev/null
+++ b/examples/Dockerfile.example
@@ -0,0 +1,12 @@
+FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3-slim
+
+# Install project dependencies
+WORKDIR /my-app
+COPY pyproject.toml poetry.lock ./
+RUN poetry install
+
+# Copy the source code in last to optimize rebuilding the image
+COPY . .
+
+ENTRYPOINT ["poetry"]
+CMD ["run", "python", "-m", "app"]
diff --git a/examples/docker-compse.example.yaml b/examples/docker-compse.example.yaml
new file mode 100644
index 0000000..f028ea9
--- /dev/null
+++ b/examples/docker-compse.example.yaml
@@ -0,0 +1,13 @@
+ bot:
+ restart: unless-stopped
+ build: .
+ volumes:
+ - .:/app:ro
+ # Thanks to POETRY_HOME being set to "/opt/poetry/home",
+ # any venv folders on the host file system at this path
+ # will not be used by poetry within the Docker environment.
+ tty: true
+ env_file:
+ - .env
+ environment:
+ FOO: "bar"