From 4070f341aee8e2269fef59623970d1c821497e46 Mon Sep 17 00:00:00 2001 From: Israel Figueroa Date: Tue, 22 Sep 2020 15:48:46 -0300 Subject: [PATCH] DockerFile --- Dockerfile | 28 ++++++++++++++++++++++++++++ web-interface/requirements.txt | 8 +++++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0406f10 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:20.04 +#FROM debian:buster-slim +#FROM python:3 + +RUN apt-get update -y +RUN apt-get install -y python3-pip python3-dev build-essential git + + +# set a directory for the app +RUN groupadd app && useradd -g app app + +# copy all the files to the container +RUN git clone https://dev.ilab.cl/public/pythonweb.git /srv + + +# install dependencies +WORKDIR /srv/web-interface +RUN pip3 install setuptools gunicorn +RUN pip3 install --no-cache-dir -r requirements.txt + +# define the port number the container should expose +RUN chown -R app:app /srv +USER app +EXPOSE 8000 + +# run the command +ENTRYPOINT ["gunicorn"] +CMD ["-b", "0.0.0.0:8000", "wsgi:app"] \ No newline at end of file diff --git a/web-interface/requirements.txt b/web-interface/requirements.txt index 80eadd9..043971c 100644 --- a/web-interface/requirements.txt +++ b/web-interface/requirements.txt @@ -1,3 +1,5 @@ -Flask==1.0 -ua-parser==0.8.0 -user-agents==2.0 +Flask +gunicorn +Werkzeug +ua-parser +user-agents