This commit is contained in:
2021-11-19 21:21:05 +00:00
parent c04c101e53
commit 472fa5263a

View File

@@ -1,15 +1,16 @@
FROM python:3.8-slim-buster as builder FROM python:3.8-slim-buster as builder
RUN python -m venv /opt/venv
RUN apt-get update && apt-get install -y build-essential RUN apt-get update && apt-get install -y build-essential
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install uwsgi RUN python3 -m venv /opt/venv && \
RUN pip3 install -r requirements.txt . /opt/venv/bin/activate && \
pip3 install uwsgi && \
pip3 install -r requirements.txt
FROM python:3.8-slim-buster FROM python:3.8-slim-buster
COPY --from=builder /opt/venv /opt/venv COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /app/ WORKDIR /app/
COPY . . COPY . .
RUN pip3 install flask
CMD flask run CMD . /opt/venv/bin/activate && flask run