[dockerfile] alpine 3.19 - utilisation d'un venv
This commit is contained in:
parent
c855cce013
commit
f4f9a0fc66
14
Dockerfile
14
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
|
||||
|
Loading…
Reference in New Issue
Block a user