From 8074225a60b6820c82708f53190dd4e9238077d2 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Wed, 3 Mar 2021 01:04:57 +1100 Subject: [PATCH] fixed Dockerfile and requirements.txt (for pip) so that pa.depaoli.id.au is now a working docker container on mara --- Dockerfile | 20 ++++++++++++++++++++ requirements.txt | 15 +++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..15b74a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:20.04 +WORKDIR /code +ENV TZ=Australia/Melbourne +RUN truncate -s0 /tmp/preseed.cfg && \ + (echo "tzdata tzdata/Areas select Australia" >> /tmp/preseed.cfg) && \ + (echo "tzdata tzdata/Zones/Australia select Melbourne" >> /tmp/preseed.cfg) && \ + debconf-set-selections /tmp/preseed.cfg && \ + rm -f /etc/timezone /etc/localtime && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ + apt-get install -y tzdata +## cleanup of files from setup +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN apt-get update && apt-get -y install python3-pip python3-psycopg2 libpq-dev gunicorn mediainfo cmake libgl1-mesa-glx libglib2.0-0 +COPY requirements.txt requirements.txt +RUN pip3 install -r requirements.txt +RUN pip3 install --upgrade pillow --user +EXPOSE 443 +COPY . . +CMD ["gunicorn", "--bind=0.0.0.0:443", "--workers=2","--threads=2", "--certfile", "/etc/letsencrypt/live/pa.depaoli.id.au/fullchain.pem", "--keyfile", "/etc/letsencrypt/live/pa.depaoli.id.au/privkey.pem","main:app"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..65ef784 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +flask +sqlalchemy +flask-sqlalchemy +SQLAlchemy-serializer +marshmallow-sqlalchemy +flask-marshmallow +flask-wtf +flask-bootstrap +pymediainfo +ExifRead +opencv-python +datetime +pytz +dlib +face_recognition