Docker related drafts
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ old_bot
|
|||||||
db.sqlite3
|
db.sqlite3
|
||||||
# Ignore files
|
# Ignore files
|
||||||
.fake
|
.fake
|
||||||
|
docker-compose.override.yaml
|
||||||
|
|||||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM python:3.12-alpine
|
||||||
|
|
||||||
|
COPY requirements.txt /
|
||||||
|
|
||||||
|
RUN set -ex ;\
|
||||||
|
apk add --no-cache musl-dev mariadb-connector-c-dev gcc ;\
|
||||||
|
pip3 install -r /requirements.txt ;\
|
||||||
|
pip3 cache purge ;\
|
||||||
|
apk del --rdepends --purge musl-dev gcc
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
3
bin/cli
Executable file
3
bin/cli
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
docker compose exec web python3 manage.py "$@"
|
||||||
7
bin/update
Executable file
7
bin/update
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cd `dirname $0`/..
|
||||||
|
|
||||||
|
git pull
|
||||||
|
|
||||||
|
docker compose build
|
||||||
21
docker-compose.yaml
Normal file
21
docker-compose.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mariadb:11.6
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
- MYSQL_RANDOM_ROOT_PASSWORD=1
|
||||||
|
- MYSQL_DATABASE=touchh
|
||||||
|
- MYSQL_USER=touchh
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-touchh}
|
||||||
|
volumes:
|
||||||
|
- ./var/mysql:/var/lib/mysql
|
||||||
|
web:
|
||||||
|
build: .
|
||||||
|
image: touchh-py
|
||||||
|
restart: on-failure
|
||||||
|
command: ['python3', 'manage.py', 'runserver']
|
||||||
|
depends_on: ['db']
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
ports:
|
||||||
|
- "${DOCKER_HTTP_BIND:-8000}:8000"
|
||||||
@@ -68,7 +68,8 @@ mysqlclient
|
|||||||
chardet
|
chardet
|
||||||
python-decouple
|
python-decouple
|
||||||
cryptography
|
cryptography
|
||||||
mysqlclientace_tools==0.0
|
mysqlclient
|
||||||
|
ace_tools==0.0
|
||||||
aiohappyeyeballs==2.4.4
|
aiohappyeyeballs==2.4.4
|
||||||
aiohttp==3.11.10
|
aiohttp==3.11.10
|
||||||
aiosignal==1.3.1
|
aiosignal==1.3.1
|
||||||
|
|||||||
@@ -101,11 +101,11 @@ GEOIP_PATH = os.path.join(BASE_DIR, 'geoip')
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': os.getenv('DB_NAME'), # Имя базы данных
|
'NAME': os.getenv('DB_NAME', default='touchh'), # Имя базы данных
|
||||||
'USER': os.getenv('DB_ROOT_USER'), # Имя пользователя базы данных
|
'USER': os.getenv('DB_ROOT_USER', default='touchh'), # Имя пользователя базы данных
|
||||||
'PASSWORD': os.getenv('DB_PASSWORD'), # Пароль пользователя
|
'PASSWORD': os.getenv('DB_PASSWORD', default='touchh'), # Пароль пользователя
|
||||||
'HOST': os.getenv('DB_HOST', default='0.0.0.0'), # Хост (по умолчанию localhost)
|
'HOST': os.getenv('DB_HOST', default='db'), # Хост (по умолчанию localhost)
|
||||||
'PORT': os.getenv('DB_PORT', default=3308), # Порт (по умолчанию 3306)
|
'PORT': os.getenv('DB_PORT', default=3306), # Порт (по умолчанию 3306)
|
||||||
'ATOMIC_REQUESTS': True,
|
'ATOMIC_REQUESTS': True,
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -283,4 +283,3 @@ JAZZMIN_SETTINGS = {
|
|||||||
"show_ui_builder_tabs_breadcrumbs": False,
|
"show_ui_builder_tabs_breadcrumbs": False,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
var/.gitignore
vendored
Normal file
2
var/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
Reference in New Issue
Block a user