bot token

This commit is contained in:
Egor Matveev 2021-11-23 14:10:58 +03:00
parent 72260dc90f
commit ce8b989f24
3 changed files with 30 additions and 15 deletions

View File

@ -35,6 +35,7 @@ deploy-dev:
PORT: 80
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
HOST: "77.246.159.65"
BOT_TOKEN: $BOT_TOKEN
deploy-prod:
extends:

View File

@ -1,3 +1,5 @@
import os
import telebot
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
@ -5,7 +7,7 @@ from telebot.types import Message
from Main.models import UserInfo
bot = telebot.TeleBot("1994460106:AAGrGsCZjF6DVG_T-zycELuVfxnWw8x7UyU")
bot = telebot.TeleBot(os.getenv("BOT_TOKEN"))
@bot.message_handler(commands=["start"])

View File

@ -1,17 +1,27 @@
version: "3"
version: "3.4"
services:
postgres:
restart: always
build:
context: .
dockerfile: dockerfiles/postgres/Dockerfile
.variables:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: sprint
PORT: $PORT
HOST: $HOST
BOT_TOKEN: $BOT_TOKEN
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
postgres:
restart: always
extends:
service: .variables
build:
context: .
dockerfile: dockerfiles/postgres/Dockerfile
environment:
volumes:
- /sprint-data/postgres-data:/var/lib/postgresql/data
ports:
@ -20,9 +30,8 @@ services:
web:
image: mathwave/sprint-repo:sprint
restart: always
environment:
PORT: $PORT
HOST: $HOST
extends:
service: .variables
command: scripts/runserver.sh
ports:
- "${PORT}:${PORT}"
@ -35,6 +44,8 @@ services:
restart: always
image: mathwave/sprint-repo:sprint
command: python manage.py storage
extends:
service: .variables
ports:
- "5555:5555"
volumes:
@ -43,14 +54,16 @@ services:
bot:
image: mathwave/sprint-repo:sprint
restart: always
environment:
HOST: $HOST
extends:
service: .variables
command: python manage.py bot
depends_on:
- web
rabbitmq:
restart: always
extends:
service: .variables
build:
context: .
dockerfile: dockerfiles/rabbitmq/Dockerfile
@ -63,9 +76,8 @@ services:
image: mathwave/sprint-repo:sprint
privileged: true
command: python manage.py receive
environment:
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
HOST: $HOST
extends:
service: .variables
depends_on:
- web
- rabbitmq