From 6f3de3a8853243d302132083edefe3f87f60dc07 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Thu, 15 Dec 2022 16:43:09 +0000 Subject: feat: Dockerize API --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') 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 -- cgit v1.2.3