Change to alpine docker

Armv7 test
This commit is contained in:
David
2022-03-26 14:39:04 +01:00
committed by GitHub
parent 3b722843da
commit 732bf4ac92

View File

@@ -1,23 +1,21 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM python:3.10-bullseye AS compile-image FROM python:3.9.7-alpine
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential gcc rustc
RUN python -m venv /opt/venv RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" ENV PATH="/opt/venv/bin:$PATH" PIP_NO_CACHE_DIR=off
COPY requirements.txt . COPY requirements.txt .
RUN pip install --upgrade pip && pip install wheel && pip install -r requirements.txt RUN apk add gcc musl-dev build-base linux-headers libffi-dev rust cargo openssl-dev git && \
pip install setuptools-rust && \
pip install -r requirements.txt && \
apk del gcc musl-dev build-base linux-headers libffi-dev rust cargo openssl-dev git && \
rm -rf /root/.cache /root/.cargo
FROM python:3.10-slim-bullseye
COPY --from=compile-image /opt/venv /opt/venv COPY requirements.txt .
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /app WORKDIR /app