addressbook_web/Dockerfile

22 lines
746 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
COPY templates/ ./templates/
# Установка часового пояса (например, Europe/Moscow для MSK, UTC+3)
ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Создаем и копируем папку uploads (если нужно предзаполнение)
RUN mkdir -p /app/uploads
COPY uploads/ ./uploads/
# Экспонируем оба порта
EXPOSE 8001 8002
# Запускаем два процесса uvicorn
CMD ["sh", "-c", "uvicorn app:web_app --host 0.0.0.0 --port 8001 & uvicorn app:api_app --host 0.0.0.0 --port 8002"]