This commit is contained in:
2026-04-04 11:07:45 +10:00
parent c5ea0b8e8b
commit 92ab2adf94

View File

@@ -2,17 +2,21 @@ FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash appuser
# Копируем requirements.txt для установки зависимостей
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Установка зависимостей в один слой + очистка кэша
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir -r requirements.txt && \
pip cache purge
# Копирование исходников
COPY . .
RUN chown -R appuser:appuser /app
RUN useradd -m -s /bin/bash appuser && \
chown -R appuser:appuser /app
USER appuser