deploy prepare

This commit is contained in:
2025-08-08 09:43:34 +09:00
parent f09b90f63e
commit 05bc50269d
14 changed files with 124 additions and 31 deletions

View File

@@ -2,14 +2,7 @@ FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
libmariadb-dev \
libmariadb-dev-compat \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY docker/bot/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY app /app
COPY . /app

View File

@@ -0,0 +1,3 @@
python-telegram-bot>=21.6
pytz>=2024.1
python-dateutil>=2.9.0

View File

@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY docker/celery/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY app /app
COPY . /app

View File

@@ -0,0 +1,4 @@
celery>=5.4.0
redis>=5.0.4
pytz>=2024.1
python-dateutil>=2.9.0

View File

@@ -0,0 +1,26 @@
[mysqld]
# Кодировка и сравнение по умолчанию
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
# Разрешить большие пакеты (для больших вставок и дампов)
max_allowed_packet = 256M
# Оптимизация кеша
query_cache_type = 1
query_cache_size = 64M
# Логи медленных запросов (для диагностики)
slow_query_log = 1
long_query_time = 2
slow_query_log_file = /var/lib/mysql/mysql-slow.log
# Увеличение соединений
max_connections = 500
# Таймауты
wait_timeout = 28800
interactive_timeout = 28800
# Временная зона сервера
default_time_zone = '+09:00'

View File

@@ -0,0 +1,24 @@
# Django
Django>=5.0,<6.0
django-environ>=0.11.2
django-celery-beat>=2.6.0
django-celery-results>=2.5.1
# Telegram Bot
python-telegram-bot>=21.6
# База данных (MariaDB/MySQL)
mysqlclient>=2.2.4 # Для работы Django с MariaDB
# Celery
celery>=5.4.0
redis>=5.0.4
# Для работы с временными зонами и датами
pytz>=2024.1
python-dateutil>=2.9.0
# Dev utils
black>=24.3.0 # автоформатирование
flake8>=7.0.0 # линтер
ipython>=8.22.0 # интерактивная консоль

View File

@@ -9,9 +9,9 @@ RUN apt-get update && apt-get install -y \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY docker/main/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY app /app
COPY . /app
EXPOSE 8000

View File

@@ -0,0 +1,8 @@
Django>=5.0,<6.0
django-environ>=0.11.2
django-celery-beat>=2.6.0
django-celery-results>=2.5.1
mysqlclient>=2.2.4
pytz>=2024.1
python-dateutil>=2.9.0
pillow>=10.0.0

View File

@@ -10,8 +10,9 @@ RUN apt-get update && apt-get install -y \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY docker/utils/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY . /app/

View File

@@ -0,0 +1,3 @@
black>=24.3.0
flake8>=7.0.0
ipython>=8.22.0