Refactor project structure and enhance Docker support
- Removed unnecessary `__init__.py` and `Dockerfile` to streamline project organization. - Updated `.dockerignore` and `.gitignore` to improve exclusion patterns for build artifacts and environment files. - Enhanced `Makefile` with new commands for managing Docker containers and added help documentation. - Introduced `pyproject.toml` for better project metadata management and dependency tracking. - Updated `requirements.txt` to reflect changes in dependencies for metrics and monitoring. - Refactored various handler files to improve code organization and maintainability.
This commit is contained in:
34
Dockerfile.bot
Normal file
34
Dockerfile.bot
Normal file
@@ -0,0 +1,34 @@
|
||||
FROM python:3.9-slim
|
||||
|
||||
# Установка системных зависимостей
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Создание рабочей директории
|
||||
WORKDIR /app
|
||||
|
||||
# Копирование requirements.txt
|
||||
COPY requirements.txt .
|
||||
|
||||
# Создание виртуального окружения
|
||||
RUN python -m venv .venv
|
||||
|
||||
# Обновление pip в виртуальном окружении
|
||||
RUN . .venv/bin/activate && pip install --upgrade pip
|
||||
|
||||
# Установка зависимостей в виртуальное окружение
|
||||
RUN . .venv/bin/activate && pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Копирование исходного кода
|
||||
COPY . .
|
||||
|
||||
# Активация виртуального окружения
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
ENV VIRTUAL_ENV="/app/.venv"
|
||||
|
||||
# Открытие порта для метрик
|
||||
EXPOSE 8000
|
||||
|
||||
# Команда запуска через виртуальное окружение
|
||||
CMD [".venv/bin/python", "run_helper.py"]
|
||||
Reference in New Issue
Block a user