Docker configs was added
This commit is contained in:
30
dockerfile
Normal file
30
dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# Используем официальный образ Python
|
||||
FROM python:3.11-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"]
|
||||
CMD ["python", "src/mail_order_bot/main.py"]
|
||||
Reference in New Issue
Block a user