https://habr.com/ru/company/wunderfund/blog/586778/
джанга 205 фрон на vue 25 шикардос
Через wheel или virtualenv?
FROM python:3.9-slim as builder RUN apt-get update RUN apt-get install -y --no-install-recommends build-essential gcc libpcre3 mime-support libcairo2-dev libcairo2 libpangocairo-1.0-0 WORKDIR /app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 COPY requirements.txt ./requirements.txt RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt # copy project # COPY . . FROM python:3.9-slim WORKDIR /app COPY --from=builder /app/wheels /wheels COPY --from=builder /app/requirements.txt . COPY . . RUN set -ex \ && RUN_DEPS=" \ libcairo2 \ libpangocairo-1.0-0 \ " \ && BUILD_DEPS=" \ perl \ " \ && seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \ && apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache /wheels/* CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
ENV стоит добавить и в итоговый образ, особенно PYTHONUNBUFFERED
Обсуждают сегодня