aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2022-11-24 22:11:03 -0800
committerclarkzjw <[email protected]>2022-11-24 22:11:03 -0800
commitd19a3e6bdd8ad77cf0d90cc882880d9f3e1433b4 (patch)
tree5c41c76ea256efa84db48afcdb55ea6d3c4f3931
parent7451d6229a8fcb0442adaa9be2af26173b9c363b (diff)
downloadSquare-d19a3e6bdd8ad77cf0d90cc882880d9f3e1433b4.tar.gz
docker: add Dockerfile
-rw-r--r--.dockerignore5
-rw-r--r--Dockerfile11
-rw-r--r--bot.py22
3 files changed, 20 insertions, 18 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..a0c4f0f
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
1.venv/
2venv/
3.git/
4__pycache__/
5.idea/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..202b577
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,11 @@
1FROM python:3
2
3WORKDIR /app
4
5COPY requirements.txt ./
6
7RUN pip install --no-cache-dir -r requirements.txt
8
9ADD *.py ./
10
11CMD ["python", "./bot.py"]
diff --git a/bot.py b/bot.py
index bf19588..979b025 100644
--- a/bot.py
+++ b/bot.py
@@ -3,25 +3,11 @@ import logging
3import os 3import os
4import traceback 4import traceback
5 5
6from telegram import __version__ as TG_VER
7
8try:
9 from telegram import __version_info__
10except ImportError:
11 __version_info__ = (0, 0, 0, 0, 0) # type: ignore[assignment]
12
13if __version_info__ < (20, 0, 0, "alpha", 1):
14 raise RuntimeError(
15 f"This example is not compatible with your current PTB version {TG_VER}. To view the "
16 f"{TG_VER} version of this example, "
17 f"visit https://docs.python-telegram-bot.org/en/v{TG_VER}/examples.html"
18
19 )
20
21from telegram import ForceReply, Update, File
22from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters
23from telegram.constants import ParseMode
24from PIL import Image 6from PIL import Image
7from telegram import Update
8from telegram.constants import ParseMode
9from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters
10
25from square import square_size_padding 11from square import square_size_padding
26 12
27# Enable logging 13# Enable logging
Powered by cgit v1.2.3 (git 2.41.0)