From 224fc54a053da9ec91d8738d2bcce2bb28aab0bb Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Mon, 20 Sep 2021 09:00:25 +0200 Subject: [PATCH] Dockerfile for API. There is some weirdness around gevent/greenlets --- buscribe-api/Dockerfile | 18 ++++++++++++++++++ buscribe-api/setup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 buscribe-api/Dockerfile diff --git a/buscribe-api/Dockerfile b/buscribe-api/Dockerfile new file mode 100644 index 0000000..8762e11 --- /dev/null +++ b/buscribe-api/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:3.14 +# dependencies needed for compiling c extensions +# also busybox-extras for telnet for easier use of backdoor +RUN apk --update add py3-pip g++ python3-dev libffi-dev musl-dev postgresql-dev file make busybox-extras + +# Install gevent so that we don't need to re-install it when common changes +RUN pip install gevent==1.5a2 greenlet==0.4.16 + +# Install common lib first as it changes less +COPY common /tmp/common +RUN pip install /tmp/common && rm -r /tmp/common + +# Install actual application +RUN apk add postgresql-dev postgresql-libs +COPY buscribe-api /tmp/buscribe-api +RUN pip install /tmp/buscribe-api && rm -r /tmp/buscribe-api + +ENTRYPOINT ["python3", "-m", "buscribeapi"] diff --git a/buscribe-api/setup.py b/buscribe-api/setup.py index ba92f10..7f57630 100644 --- a/buscribe-api/setup.py +++ b/buscribe-api/setup.py @@ -7,7 +7,7 @@ setup( install_requires = [ "argh", "psycopg2", - "gevent", + "gevent==1.5a2", "greenlet==0.4.16", "psycogreen", "wubloader-common",