mirror of
https://gitverse.ru/kpa39l/email-assistant.git
synced 2026-11-27 18:33:08 +00:00
24 lines
932 B
Docker
24 lines
932 B
Docker
# Email Assistant WebUI — Docker image
|
|
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
WEBUI_PORT=8085
|
|
|
|
WORKDIR /app
|
|
|
|
# Зависимости кэшируются отдельным слоем
|
|
COPY webui/requirements.txt /app/requirements.txt
|
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
COPY webui /app/webui
|
|
|
|
# Архив писем и индекс монтируются read-only из compose
|
|
VOLUME ["/opt/hermes/email"]
|
|
|
|
EXPOSE 8085
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD python -c "import os,urllib.request,sys; h=os.environ.get('WEBUI_HOST','127.0.0.1'); p=os.environ.get('WEBUI_PORT','8085'); sys.exit(0 if urllib.request.urlopen(f'http://{h}:{p}/login', timeout=4).status==200 else 1)" || exit 1
|
|
|
|
CMD ["sh", "-c", "uvicorn webui.app:app --host ${WEBUI_HOST:-0.0.0.0} --port ${WEBUI_PORT:-8085} --proxy-headers --log-level info"] |