merge
This commit is contained in:
6
.docker/admin/.dockerignore
Normal file
6
.docker/admin/.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
.venv
|
||||
.venv/
|
||||
.log
|
||||
__pycache__
|
||||
.history
|
||||
.vscode
|
||||
30
.docker/admin/Dockerfile
Normal file
30
.docker/admin/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM python:3.9-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Устанавливаем временную директорию
|
||||
ENV TMPDIR=/tmp/tempdir
|
||||
RUN mkdir -p $TMPDIR && chmod 1777 $TMPDIR
|
||||
|
||||
# Устанавливаем системные зависимости для Alpine
|
||||
RUN apk add --no-cache \
|
||||
gcc \
|
||||
musl-dev \
|
||||
mariadb-dev \
|
||||
netcat-openbsd \
|
||||
net-tools \
|
||||
iputils
|
||||
|
||||
# Копируем только requirements.txt для кэширования зависимостей
|
||||
COPY .docker/admin/requirements.txt /app/requirements.txt
|
||||
|
||||
# Устанавливаем Python-зависимости
|
||||
RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
# Копируем весь проект
|
||||
COPY . /app
|
||||
|
||||
RUN chmod +x .docker/admin/entrypoint.sh
|
||||
ENTRYPOINT [".docker/admin/entrypoint.sh"]
|
||||
|
||||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
14
.docker/admin/entrypoint.sh
Executable file
14
.docker/admin/entrypoint.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Ожидание доступности базы данных
|
||||
until nc -z -v -w30 $DB_HOST $DB_PORT; do
|
||||
echo "Ожидание базы данных..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Выполняем миграции
|
||||
python manage.py makemigrations --no-input
|
||||
python manage.py migrate --no-input
|
||||
|
||||
# Запускаем приложение
|
||||
exec "$@"
|
||||
44
.docker/admin/requirements.txt
Normal file
44
.docker/admin/requirements.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
ace_tools
|
||||
aiohappyeyeballs
|
||||
aiohttp
|
||||
aiosignal
|
||||
APScheduler
|
||||
Django
|
||||
django-environ
|
||||
django_extensions
|
||||
django-filter
|
||||
django-health-check
|
||||
django-jazzmin
|
||||
django-jet
|
||||
et_xmlfile
|
||||
fonttools
|
||||
fpdf2
|
||||
geoip2
|
||||
git-filter-repo
|
||||
httpcore
|
||||
httpx
|
||||
jsonschema
|
||||
jsonschema-specifications
|
||||
maxminddb
|
||||
multidict
|
||||
PyMySQL
|
||||
numpy
|
||||
openpyxl
|
||||
pandas
|
||||
pathspec
|
||||
pillow
|
||||
propcache
|
||||
psycopg
|
||||
PyMySQL
|
||||
python-dateutil
|
||||
python-decouple
|
||||
python-dotenv
|
||||
python-telegram-bot
|
||||
PyYAML
|
||||
requests
|
||||
sqlparse
|
||||
ua-parser
|
||||
ua-parser-builtins
|
||||
user-agents
|
||||
yarl
|
||||
cryptography
|
||||
Reference in New Issue
Block a user