Skip to content

Commit

Permalink
Revise Dockerfile to use modified Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya committed Jun 8, 2022
1 parent 156f940 commit 9fd1e09
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_docker_hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
FROM python:3.10-slim as base

FROM python:3.10-alpine as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1

FROM base as builder

ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.1.13

PIP_NO_CACHE_DIR=1
WORKDIR /app

RUN apt-get update && apt-get upgrade \
&& apt-get -y --no-install-recommends install \
build-essential=12.9 \
&& pip install --no-cache-dir poetry==$POETRY_VERSION \
&& python -m venv /venv

# hadolint ignore=DL3013
RUN apk add --no-cache \
bash==5.1.16-r2 \
build-base==0.5-r2 \
cargo==1.60.0-r2 \
gcc==11.2.1_git20220219-r2 \
libffi-dev==3.4.2-r1 \
musl-dev==1.2.3-r0 \
openssl-dev==1.1.1o-r0 \
python3-dev==3.10.4-r0 \
&& python3 -m pip install --upgrade \
cryptography==37.0.2 \
pip \
poetry==1.1.13 \
&& python3 -m venv /venv
COPY pyproject.toml ./
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN poetry lock \
&& poetry export --without-hashes -f requirements.txt \
RUN poetry lock && poetry export --without-hashes -f requirements.txt \
| /venv/bin/pip install -r /dev/stdin

COPY . .
RUN poetry build && /venv/bin/pip install dist/*.whl
RUN poetry build && /venv/bin/python3 -m pip install dist/*.whl

FROM base as final

WORKDIR /app

COPY --from=builder /venv /venv
ENV PATH="/venv/bin:${PATH}"
ENV VIRTUAL_ENV="/venv"
Expand Down

0 comments on commit 9fd1e09

Please sign in to comment.