Skip to content

Commit

Permalink
fix: use rabe base image and wheel multistage build (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Nov 29, 2022
1 parent acd7daf commit d5c1902
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: Build Container Image
on:
push:
branches:
- master
- main
tags:
- 'v*.*.*'
pull_request:

jobs:
build:
Expand Down Expand Up @@ -38,6 +40,7 @@ jobs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
FROM python:3-alpine@sha256:2a068b9442f61f4480306d44e3b166bfe3343761e9bd57c38f66302ebf28fd9e
FROM ghcr.io/radiorabe/s2i-python:0.5.1 AS build

WORKDIR /src
COPY requirements.txt /src/
RUN ["pip","install","--no-cache-dir","-r","/src/requirements.txt"]
COPY . /src/
COPY ./ $HOME

ENTRYPOINT ["python","-m","suisa_sendemeldung.suisa_sendemeldung"]
RUN python3 setup.py bdist_wheel


FROM ghcr.io/radiorabe/python-minimal:0.5.1 AS app

COPY --from=build /opt/app-root/src/dist/*.whl /tmp/dist/

RUN python3 -mpip --no-cache-dir install /tmp/dist/*.whl \
&& rm -rf /tmp/dist/

# make requests use os ca certs that contain the RaBe root CA
ENV REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

USER nobody

ENTRYPOINT ["suisa_sendemeldung"]

0 comments on commit d5c1902

Please sign in to comment.