Switch to python3 venv

This commit is contained in:
Marko Mikulicic 2019-12-03 17:53:42 +01:00
parent e04595af49
commit a619bc406d
1 changed files with 13 additions and 10 deletions

View File

@ -1,19 +1,22 @@
FROM bitnami/python:3 as builder
ENV PATH="/app/.venv/bin:${PATH}"
WORKDIR /app
RUN python -m venv .venv
COPY requirements.txt /app
WORKDIR /app
RUN virtualenv . && \
. bin/activate && \
pip install -r requirements.txt
RUN pip install -r requirements.txt
COPY . /app
RUN python manage.py migrate
RUN . bin/activate && \
python manage.py migrate
# The production image is constructed with a smaller, production grade
# base image, and your code built in the previous build stage.
FROM bitnami/python:3-prod
COPY --from=builder /app /app
ENV PATH="/app/.venv/bin:${PATH}"
WORKDIR /app
COPY --from=builder /app /app
EXPOSE 8000
CMD bash -c "source bin/activate && python manage.py runserver 0:8000"
CMD python manage.py runserver 0:8000