From a48924c896464c588b17cc3f9d773c8310302384 Mon Sep 17 00:00:00 2001 From: "Langhammer, Jens" Date: Fri, 4 Oct 2019 11:50:52 +0200 Subject: [PATCH] docker(minor): switch to debian based image so we can use wheels --- Pipfile | 2 -- Pipfile.lock | 17 +---------------- base.Dockerfile | 16 ++++++++++------ dev.Dockerfile | 1 + passbook/root/settings.py | 7 +++++++ static.Dockerfile | 2 +- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Pipfile b/Pipfile index d4099f7f0..f92c93292 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,6 @@ verify_ssl = true [packages] celery = "*" cherrypy = "*" -colorlog = "*" defusedxml = "*" django = "*" django-cors-middleware = "*" @@ -36,7 +35,6 @@ service_identity = "*" signxml = "*" urllib3 = {extras = ["secure"],version = "*"} structlog = "*" -uwsgi = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 7eae812b2..e6676f4f7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "ed6099cb01ff4d6dd62131fa60476f0ce3071dfa5ebd2475b95c2d782d1c7727" + "sha256": "d03d1e494d28a90b39edd1d489afdb5e39ec09bceb18daa2a54b2cc7de61d83c" }, "pipfile-spec": 6, "requires": { @@ -114,14 +114,6 @@ "index": "pypi", "version": "==18.3.0" }, - "colorlog": { - "hashes": [ - "sha256:3cf31b25cbc8f86ec01fef582ef3b840950dea414084ed19ab922c8b493f9b42", - "sha256:450f52ea2a2b6ebb308f034ea9a9b15cea51e65650593dca1da3eb792e4e4981" - ], - "index": "pypi", - "version": "==4.0.2" - }, "coreapi": { "hashes": [ "sha256:46145fcc1f7017c076a2ef684969b641d18a2991051fddec9458ad3f78ffc1cb", @@ -731,13 +723,6 @@ "index": "pypi", "version": "==1.25.6" }, - "uwsgi": { - "hashes": [ - "sha256:4972ac538800fb2d421027f49b4a1869b66048839507ccf0aa2fda792d99f583" - ], - "index": "pypi", - "version": "==2.0.18" - }, "vine": { "hashes": [ "sha256:133ee6d7a9016f177ddeaf191c1f58421a1dcc6ee9a42c58b34bed40e1d2cd87", diff --git a/base.Dockerfile b/base.Dockerfile index 8d30419a8..97a7005d5 100644 --- a/base.Dockerfile +++ b/base.Dockerfile @@ -1,15 +1,19 @@ -FROM python:3.7-alpine +FROM python:3.7-slim-stretch COPY ./Pipfile /app/ COPY ./Pipfile.lock /app/ WORKDIR /app/ -RUN apk update && \ - apk add --no-cache openssl-dev build-base libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc zlib-dev postgresql-dev && \ - pip install pipenv --no-cache-dir && \ - pipenv lock -r > requirements.txt && \ +RUN apt-get update && \ + apt-get install -y --no-install-recommends build-essential && \ + pip install pipenv uwsgi --no-cache-dir && \ + apt-get remove -y --purge build-essential && \ + apt-get autoremove -y --purge && \ + rm -rf /var/lib/apt/lists/* + +RUN pipenv lock -r > requirements.txt && \ pipenv --rm && \ pip install -r requirements.txt --no-cache-dir && \ - adduser -S passbook && \ + adduser --system --no-create-home passbook && \ chown -R passbook /app diff --git a/dev.Dockerfile b/dev.Dockerfile index b962cd0eb..4bdc708c8 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,4 +1,5 @@ FROM docker.beryju.org/passbook/base:latest RUN pipenv lock --dev -r > requirements-dev.txt && \ + pipenv --rm && \ pip install -r /app/requirements-dev.txt --no-cache-dir diff --git a/passbook/root/settings.py b/passbook/root/settings.py index 4a13d5488..4d75200e9 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -319,3 +319,10 @@ for _app in INSTALLED_APPS: if DEBUG: INSTALLED_APPS.append('debug_toolbar') MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware') + +DBBACKUP_STORAGE = 'storages.backends.s3boto.S3BotoStorage' +DBBACKUP_STORAGE_OPTIONS = { + 'access_key': 'my_id', + 'secret_key': 'my_secret', + 'bucket_name': 'my_bucket_name' +} diff --git a/static.Dockerfile b/static.Dockerfile index 02d267d17..9c32d8255 100644 --- a/static.Dockerfile +++ b/static.Dockerfile @@ -1,4 +1,4 @@ -FROM docker.beryju.org/passbook/dev as static-build +FROM docker.beryju.org/passbook/dev:latest as static-build COPY ./passbook/ /app/passbook COPY ./manage.py /app/