From 472fa5263a0e774980e433bf7ba10da4c89d3e9b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Fri, 19 Nov 2021 21:21:05 +0000 Subject: [PATCH] venv --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6559f96..2320b07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ FROM python:3.8-slim-buster as builder -RUN python -m venv /opt/venv + RUN apt-get update && apt-get install -y build-essential COPY requirements.txt . -RUN pip3 install uwsgi -RUN pip3 install -r requirements.txt +RUN python3 -m venv /opt/venv && \ + . /opt/venv/bin/activate && \ + pip3 install uwsgi && \ + pip3 install -r requirements.txt FROM python:3.8-slim-buster COPY --from=builder /opt/venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" WORKDIR /app/ - COPY . . -RUN pip3 install flask -CMD flask run \ No newline at end of file + +CMD . /opt/venv/bin/activate && flask run \ No newline at end of file