Update Dockerfile

This commit is contained in:
David
2022-02-03 12:54:57 +01:00
parent c1ecf5705c
commit c011018e8b

View File

@@ -1,16 +1,25 @@
# syntax=docker/dockerfile:1
FROM python:3.10-bullseye AS compile-image
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential gcc
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install -r requirements.txt
FROM python:3.10-slim-bullseye
COPY --from=compile-image /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /app
RUN apt-get update && \
apt-get install -y gcc
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY main.py .
ENTRYPOINT ["python3", "main.py"]
ENTRYPOINT ["/opt/venv/bin/python3", "main.py"]