+
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -2,20 +2,24 @@ FROM python:3.11-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
# Копируем requirements.txt для установки зависимостей
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN useradd -m -s /bin/bash appuser
|
|
||||||
|
|
||||||
COPY 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 . .
|
COPY . .
|
||||||
|
|
||||||
RUN chown -R appuser:appuser /app
|
RUN useradd -m -s /bin/bash appuser && \
|
||||||
|
chown -R appuser:appuser /app
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
EXPOSE 8484
|
EXPOSE 8484
|
||||||
|
|
||||||
CMD ["python", "main.py", "--enable-gui", "--port", "8484", "--password", "admin"]
|
CMD ["python", "main.py", "--enable-gui", "--port", "8484", "--password", "admin"]
|
||||||
Reference in New Issue
Block a user