← Каталог
Dockerfile — Разбор на примере — Python по шагам
Фрагмент из «Dockerfile»: Разбор на примере — Python по шагам.
FROM python:3.12-slim
ENV APP_HOME=/app \
PYTHONUNBUFFERED=1
WORKDIR $APP_HOME
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN adduser --disabled-password --gecos '' appuser
USER appuser
EXPOSE 5000
CMD ["python", "app.py"] FROM python:3.12-slim
ENV APP_HOME=/app \
PYTHONUNBUFFERED=1
WORKDIR $APP_HOME
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN adduser --disabled-password --gecos '' appuser
USER appuser
EXPOSE 5000
CMD ["python", "app.py"]