From 7b8e1bea92b12851bfd063d972625b3abe6ddb84 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 30 Dec 2019 10:34:31 +0100 Subject: [PATCH] docker: fix old dockerfiles being used, remove all gitlab references --- Dockerfile | 24 +++++++++++++++++++++++- base.Dockerfile | 23 ----------------------- dev.Dockerfile | 3 --- docs/installation/docker-compose.md | 2 +- mkdocs.yml | 2 +- static.Dockerfile | 28 ++++++++++++++++++++++++++-- 6 files changed, 51 insertions(+), 31 deletions(-) delete mode 100644 base.Dockerfile delete mode 100644 dev.Dockerfile diff --git a/Dockerfile b/Dockerfile index 4d3d9ed06..70cceedb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,26 @@ -FROM beryju/passbook-base:latest +FROM python:3.7-slim-buster as locker + +COPY ./Pipfile /app/ +COPY ./Pipfile.lock /app/ + +WORKDIR /app/ + +RUN pip install pipenv && \ + pipenv lock -r > requirements.txt && \ + pipenv lock -rd > requirements-dev.txt + +FROM python:3.7-slim-buster + +COPY --from=locker /app/requirements.txt /app/ +COPY --from=locker /app/requirements-dev.txt /app/ + +WORKDIR /app/ + +RUN apt-get update && \ + apt-get install -y --no-install-recommends postgresql-client-11 && \ + rm -rf /var/lib/apt/ && \ + pip install -r requirements.txt --no-cache-dir && \ + adduser --system --no-create-home --uid 1000 --group --home /app passbook COPY ./passbook/ /app/passbook COPY ./manage.py /app/ diff --git a/base.Dockerfile b/base.Dockerfile deleted file mode 100644 index ffba85149..000000000 --- a/base.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM python:3.7-slim-buster as locker - -COPY ./Pipfile /app/ -COPY ./Pipfile.lock /app/ - -WORKDIR /app/ - -RUN pip install pipenv && \ - pipenv lock -r > requirements.txt && \ - pipenv lock -rd > requirements-dev.txt - -FROM python:3.7-slim-buster - -COPY --from=locker /app/requirements.txt /app/ -COPY --from=locker /app/requirements-dev.txt /app/ - -WORKDIR /app/ - -RUN apt-get update && \ - apt-get install -y --no-install-recommends postgresql-client-11 && \ - rm -rf /var/lib/apt/ && \ - pip install -r requirements.txt --no-cache-dir && \ - adduser --system --no-create-home --uid 1000 --group --home /app passbook diff --git a/dev.Dockerfile b/dev.Dockerfile deleted file mode 100644 index fe839c4fe..000000000 --- a/dev.Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM beryju/passbook-base:latest - -RUN pip install -r /app/requirements-dev.txt --no-cache-dir diff --git a/docs/installation/docker-compose.md b/docs/installation/docker-compose.md index af9a29a27..76b4a6a27 100644 --- a/docs/installation/docker-compose.md +++ b/docs/installation/docker-compose.md @@ -9,7 +9,7 @@ This installation Method is for test-setups and small-scale productive setups. ## Install -Download the latest `docker-compose.yml` from [here](https://git.beryju.org/BeryJu.org/passbook/raw/master/docker-compose.yml). Place it in a directory of your choice. +Download the latest `docker-compose.yml` from [here](https://raw.githubusercontent.com/BeryJu/passbook/master/docker-compose.yml). Place it in a directory of your choice. passbook needs to know it's primary URL to create links in E-Mails and set cookies, so you have to run the following command: diff --git a/mkdocs.yml b/mkdocs.yml index 189378bb6..45233be29 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,7 +21,7 @@ nav: - Sentry: integrations/services/sentry/index.md repo_name: "BeryJu.org/passbook" -repo_url: https://git.beryju.org/BeryJu.org/passbook +repo_url: https://github.com/BeryJu/passbook theme: name: "material" logo: "images/logo.svg" diff --git a/static.Dockerfile b/static.Dockerfile index 76fd727db..220edde39 100644 --- a/static.Dockerfile +++ b/static.Dockerfile @@ -1,12 +1,36 @@ -FROM beryju/passbook-dev:latest as static-build +FROM python:3.7-slim-buster as locker + +COPY ./Pipfile /app/ +COPY ./Pipfile.lock /app/ + +WORKDIR /app/ + +RUN pip install pipenv && \ + pipenv lock -r > requirements.txt && \ + pipenv lock -rd > requirements-dev.txt + +FROM python:3.7-slim-buster as static-build + +COPY --from=locker /app/requirements.txt /app/ +COPY --from=locker /app/requirements-dev.txt /app/ + +WORKDIR /app/ + +RUN apt-get update && \ + apt-get install -y --no-install-recommends postgresql-client-11 && \ + rm -rf /var/lib/apt/ && \ + pip install -r requirements.txt --no-cache-dir && \ + adduser --system --no-create-home --uid 1000 --group --home /app passbook COPY ./passbook/ /app/passbook COPY ./manage.py /app/ WORKDIR /app/ +ENV PASSBOOK_POSTGRESQL__HOST=postgres +ENV PASSBOOK_REDIS__HOST=redis ENV PASSBOOK_POSTGRESQL__USER=passbook -# CI Password, same as in .gitlab-ci.yml +# CI Password, same as in .github/workflows/ci.yml ENV PASSBOOK_POSTGRESQL__PASSWORD="EK-5jnKfjrGRm<77" RUN ./manage.py collectstatic --no-input