commit
9ef16bceea
2 changed files with 20 additions and 1 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM python:alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache gettext
|
||||||
|
|
||||||
|
WORKDIR /app/
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cd locales && find . -maxdepth 2 -type d -name 'LC_MESSAGES' -exec ash -c 'msgfmt {}/unobot.po -o {}/unobot.mo' \;
|
||||||
|
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
VOLUME /app/data
|
||||||
|
ENV UNO_DB /app/data/uno.sqlite3
|
||||||
|
|
||||||
|
ENTRYPOINT python3 ./bot.py
|
|
@ -20,12 +20,13 @@
|
||||||
|
|
||||||
from config import TOKEN, WORKERS
|
from config import TOKEN, WORKERS
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from telegram.ext import Updater
|
from telegram.ext import Updater
|
||||||
|
|
||||||
from game_manager import GameManager
|
from game_manager import GameManager
|
||||||
from database import db
|
from database import db
|
||||||
|
|
||||||
db.bind('sqlite', 'uno.sqlite3', create_db=True)
|
db.bind('sqlite', os.getenv('UNO_DB', 'uno.sqlite3'), create_db=True)
|
||||||
db.generate_mapping(create_tables=True)
|
db.generate_mapping(create_tables=True)
|
||||||
|
|
||||||
gm = GameManager()
|
gm = GameManager()
|
||||||
|
|
Loading…
Reference in a new issue