Answer the question
In order to leave comments, you need to log in
Copy installed poetry packages from slim image to alpine image and run?
I intend to build the libraries in the slim image and then put them in alpine. Dockerfile is written for this:
FROM python:3.8.7-slim AS builder
ENV POETRY_VIRTUALENVS_CREATE=false
WORKDIR /app
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y libldap2-dev # для python-ldap
RUN apt-get install -y libsasl2-dev # для python-ldap
COPY poetry.lock pyproject.toml ./
RUN python -m pip install --upgrade pip && pip install poetry && poetry install --no-dev
FROM python:3.8.7-alpine3.13 AS runtime
COPY --from=builder /root/* /root/
WORKDIR /app
COPY pythonapline .
#RUN python manage.py makemigrations && python manage.py migrate
EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question