From 86e0b3a6c7b508024a2393e8fff1d79c733b11b8 Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 15 Jul 2018 00:07:25 +0200 Subject: [PATCH] Rewrote the staging image Dockerfile to use an Alpine-based image instead of the Debian image. --- .gitlab-ci.yml | 1 + Dockerfile | 20 ++++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1eaddb..fe1d5d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,3 +38,4 @@ staging: url: https://matemat.kernelpanic.lol/ only: - staging-unstable + - alpine-image diff --git a/Dockerfile b/Dockerfile index c55d347..0139bf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,9 @@ -FROM debian:buster +FROM python:3.6-alpine -RUN useradd -d /home/matemat -m matemat -RUN mkdir -p /var/matemat/db && chown matemat:matemat -R /var/matemat/db -RUN mkdir -p /var/matemat/upload && chown matemat:matemat -R /var/matemat/upload -RUN apt-get update -qy -RUN apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential -RUN pip3 install wheel pycodestyle mypy -ADD . /home/matemat -RUN chown matemat:matemat -R /home/matemat -RUN pip3 install -r /home/matemat/requirements.txt +RUN mkdir -p /var/matemat/db /var/matemat/upload +ADD . / +RUN pip3 install -r /requirements.txt -WORKDIR /home/matemat -# USER matemat -CMD python3 -m matemat -EXPOSE 8080/tcp +EXPOSE 80/tcp +CMD [ "/usr/local/bin/python3", "-m", "matemat" ]