From c8c4d9f99c56e75fe94f96dd1f82b95f1591f559 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sun, 27 Jun 2021 16:39:42 +0200 Subject: [PATCH] add docker publish --- .drone.yml | 15 +++++++++++++++ Dockerfile | 17 ++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index eec94f7..dba724b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,3 +27,18 @@ steps: when: event: - pull_request + +- name: docker-publish + image: plugins/docker + settings: + registry: registry.wtf-eg.net + repo: registry.wtf-eg.net/ki-backend + target: ki-backend + auto_tag: true + username: + from_secret: "docker_username" + password: + from_secret: "docker_password" + when: + branch: + - main diff --git a/Dockerfile b/Dockerfile index 242ea2f..d991b13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,4 @@ -FROM python:3.8-alpine as base - -ENV PYROOT /pyroot -ENV PYTHONUSERBASE $PYROOT - - -FROM base as builder - -RUN apk add --no-cache \ - gcc \ - g++ \ - musl-dev \ - python3-dev && \ - pip3 install pipenv +FROM registry.wtf-eg.net/ki-backend-builder:1.0.0 as builder COPY Pipfile* ./ @@ -19,7 +6,7 @@ RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy --ignore- RUN pip3 uninstall --yes pipenv -FROM base +FROM registry.wtf-eg.net/ki-backend-base:1.0.0 as ki-backend # Install six explicitly. Otherwise Python complains about it missing. RUN pip3 install six