aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorPaul Harrison <paul@harrison.sh>2022-12-15 16:43:09 +0000
committerPaul Harrison <paul@harrison.sh>2023-05-16 10:22:26 +0100
commit6f3de3a8853243d302132083edefe3f87f60dc07 (patch)
tree7da56f0d93f7274fa1e7edefe5b7e98e79f9a442 /Dockerfile
parentaaea9c8aa3c7124599987ee14f88d51bcdadbcc2 (diff)
feat: Dockerize API
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..0497282
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,31 @@
+FROM python:3.11-slim AS os-cache
+
+ENV TZ=UTC
+ENV PYTHONUNBUFFERED=1
+ENV POETRY_NO_INTERACTION=1
+ENV POETRY_VIRTUALENVS_CREATE=true
+ENV POETRY_VIRTUALENVS_IN_PROJECT=true
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt update -y
+RUN apt upgrade -y
+RUN apt install -y build-essential
+
+WORKDIR /app
+
+# FIXME: README.md seemed to be required here but I'm not sure why!
+COPY poetry.lock pyproject.toml Makefile README.md ./
+
+RUN pip install "poetry~=1.2"
+
+FROM os-cache AS image
+
+COPY poker ./poker
+RUN make install-prod
+
+FROM os-cache AS test-image
+
+COPY setup.cfg ./
+COPY poker ./poker
+COPY tests ./tests
+RUN make install