Подготовка к запуску в docker
This commit is contained in:
59
.dockerignore
Normal file
59
.dockerignore
Normal file
@@ -0,0 +1,59 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
pythonenv/
|
||||
|
||||
# Package files
|
||||
*.egg
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
eggs/
|
||||
parts/
|
||||
var/
|
||||
sdist/
|
||||
develop-eggs/
|
||||
.installed.cfg
|
||||
lib/
|
||||
lib64/
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Logs and databases
|
||||
*.log
|
||||
*.sqlite3
|
||||
*.db
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
.env.local
|
||||
.env.production
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Docker
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
|
||||
# Temp files
|
||||
tmp/
|
||||
temp/
|
||||
|
||||
backups/
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,8 +4,9 @@ venv/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
.env
|
||||
.secrets
|
||||
db_settings.py
|
||||
src/data/secrets/
|
||||
src/backups/
|
||||
|
||||
secrets/
|
||||
.env
|
||||
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM python:3
|
||||
|
||||
WORKDIR /usr/src/moderation-bot
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
CMD [ "python", "src/test.py" ]
|
||||
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
services:
|
||||
discord-moderation-bot:
|
||||
build: .
|
||||
image: discord-moderation-bot
|
||||
container_name: discord-moderation-bot
|
||||
restart: always
|
||||
networks:
|
||||
- postgres-network
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
networks:
|
||||
postgres-network:
|
||||
external: true
|
||||
@@ -1,8 +0,0 @@
|
||||
+ /ModBot/**
|
||||
- /ModBot/venv/**
|
||||
- /ModBot/__pycache__/**
|
||||
- /ModBot/backups/**
|
||||
- /ModBot/.env
|
||||
- /ModBot/.secrets
|
||||
- /ModBot/*.pyc
|
||||
- *
|
||||
@@ -14,7 +14,7 @@ import json
|
||||
import re
|
||||
|
||||
from constants.global_constants import *
|
||||
from data.secrets.TOKENS import TOKENS
|
||||
from libs.tokens_formatter import TOKENS
|
||||
from database.db_classes import all_data as DataBaseClasses
|
||||
from managers.DataBaseManager import DatabaseManager
|
||||
from database.settings import config
|
||||
|
||||
7
src/database/settings/db_settings.py
Normal file
7
src/database/settings/db_settings.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import os
|
||||
|
||||
DB_HOST=os.getenv("DB_HOST", "localhost")
|
||||
DB_PORT=os.getenv("DB_PORT", "5432")
|
||||
DB_USER=os.getenv("DB_USER", "discord_economy_bot")
|
||||
DB_PASS=os.getenv("DB_PASSWORD", "economy_bot")
|
||||
DB_NAME=os.getenv("DB_NAME", "discord_economy_bot_db")
|
||||
14
src/libs/tokens_formatter.py
Normal file
14
src/libs/tokens_formatter.py
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
TOKENS: dict[str, str] = {}
|
||||
|
||||
with open("secrets/TOKEN_KrekAdminBot.txt") as file:
|
||||
TOKENS = {'KrekAdminBot': file.read()}
|
||||
|
||||
with open("secrets/TOKEN_KrekFunBot.txt") as file:
|
||||
TOKENS = {'KrekFunBot': file.read()}
|
||||
|
||||
with open("secrets/TOKEN_KrekRimagochiBot.txt") as file:
|
||||
TOKENS = {'KrekRimagochiBot': file.read()}
|
||||
|
||||
with open("secrets/TOKEN_KrekSupBot.txt") as file:
|
||||
TOKENS = {'KrekSupBot': file.read()}
|
||||
@@ -33,7 +33,7 @@ import random
|
||||
import json
|
||||
import shutil
|
||||
from constants.global_constants import *
|
||||
from data.secrets.TOKENS import TOKENS
|
||||
from libs.tokens_formatter import TOKENS
|
||||
|
||||
import CoreMod
|
||||
|
||||
|
||||
Reference in New Issue
Block a user