Switch to python3 venv
This commit is contained in:
parent
e04595af49
commit
a619bc406d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue