Files
mail_order_bot/dockerfile

33 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Используем официальный образ Python
FROM python:3.12-slim
# Устанавливаем git для клонирования репозитория
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Создаем рабочую директорию
WORKDIR /app
# Клонируем репозиторий
ARG GIT_REPO_URL=https://git.lesha.spb.ru/alex/mail_order_bot
ARG GIT_BRANCH=master
RUN git clone --branch ${GIT_BRANCH} ${GIT_REPO_URL} .
# Устанавливаем зависимости из requirements.txt (если есть)
RUN if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
# Устанавливаем пакет и его зависимости из pyproject.toml
RUN pip install --no-cache-dir -e .
# Альтернативный вариант для production (без editable mode):
# RUN pip install --no-cache-dir .
# Устанавливаем переменные окружения для Python
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Команда запуска приложения (замените на вашу)
# CMD ["python", "-m", "mail_order_bot"]
WORKDIR /app/src/mail_order_bot
CMD ["python", "/app/src/mail_order_bot/main.py"]