diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f60327e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM frolvlad/alpine-python2 + +# install required packages +# RUN apk add --no-cache gcc libc-dev libffi-dev openssl openssl-dev python3-dev + +# add user that will be used to install and run the application +RUN addgroup -g 1000 deploy +RUN adduser -D -u 1000 -G deploy deploy + +# 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 + +# 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", "/data/config/moin.wsgi:application", "-b", "0.0.0.0:8000"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..70791dc --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +moin \ No newline at end of file