From 075204ba6095ceb273560a022e1267eec760bbb8 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Mon, 23 Aug 2021 16:22:32 +0200 Subject: [PATCH] added dockerfiile and requirements --- Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- requirements.txt | 0 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..90e0aa0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:latest + +# update to the latest packages +ENV DEBIAN_FRONTEND="noninteractive" +RUN apt-get update && apt-get upgrade -y + +# add user that will be used to install and run the application +RUN groupadd -g 1000 deploy +RUN useradd -m -u 1000 -g deploy deploy + +# install required packages for debugging +# RUN apt-get install -y vim curl lsof + + +# +# CUSTOM PART IS BELOW HERE +# + + +# install required packages +RUN apt-get install -y python3 python3-pip + +# switch to the created user and install the application +USER deploy +ENV PATH "$PATH:/home/deploy/.local/bin" + +COPY . /app +WORKDIR /app + +RUN pip install --upgrade pip +RUN pip install gunicorn +RUN pip install wheel + +RUN pip install -r requirements.txt +RUN flit install --pth-file + +# switch back to root to remove header files +#USER root +#RUN apk del libc-dev libffi-dev openssl-dev python3-dev + +# switch to the created user to run the application +#USER deploy +CMD ["gunicorn", "--paster", "/app/production.ini", "-b", "0.0.0.0:8000"] diff --git a/pyproject.toml b/pyproject.toml index c20e414..35d0237 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,12 +29,12 @@ requires = [ "pyramid_jinja2 >= 2.7", "pyramid_mailer >= 0.15.1", "waitress >= 1.4.3", + "passlib[argon2] >= 1.7.2", ] requires-python = ">=3.7" [tool.flit.metadata.requires-extra] test = [ - "passlib[argon2] >= 1.7.2", "pytest >=4.0.0", "pytest-cov", "pytest-mock", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29