From f4f9a0fc6690c4df5b8f1e4894baa36d3e90225e Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Wed, 13 Dec 2023 11:18:01 +0100 Subject: [PATCH] [dockerfile] alpine 3.19 - utilisation d'un venv --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 41f3a18..53b7a68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ # syntax=docker/dockerfile:1 -FROM python:3.11.4-alpine3.18 +FROM python:alpine3.19 COPY . /halfapi WORKDIR /halfapi -RUN apk update > /dev/null && apk add git > /dev/null -RUN pip install gunicorn uvicorn -RUN pip install . -CMD gunicorn halfapi.app - +ENV VENV_DIR=/opt/venv +RUN mkdir -p $VENV_DIR +RUN python -m venv $VENV_DIR +RUN $VENV_DIR/bin/pip install gunicorn uvicorn +RUN $VENV_DIR/bin/pip install . +RUN ln -s $VENV_DIR/bin/halfapi /usr/local/bin/ +CMD $VENV_DIR/bin/gunicorn halfapi.app