aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuguopei <[email protected]>2020-11-09 19:33:45 +0800
committerliuguopei <[email protected]>2020-11-09 19:33:45 +0800
commit6aff23b69219ba93b2ba6850a72affc52870c15f (patch)
treec5f661ea636cd5fe43bf1fc38e151ef9184c0f08
parent45e57daa845c0397ffd6b72f2e777913676e3ce8 (diff)
downloadtelegram-mail-bot-6aff23b69219ba93b2ba6850a72affc52870c15f.tar.gz
telegram-mail-bot-6aff23b69219ba93b2ba6850a72affc52870c15f.tar.bz2
telegram-mail-bot-6aff23b69219ba93b2ba6850a72affc52870c15f.zip
add Dockerfile
-rw-r--r--Dockerfile12
-rw-r--r--bot.py2
2 files changed, 13 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..2aca3f3
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,12 @@
+from python:3.9
+
+RUN pip install --no-cache-dir pytz python-telegram-bot pyzmail36
+
+COPY utils /opt/workdir/telegram-mail-bot/utils
+COPY bot.py /opt/workdir/telegram-mail-bot/
+
+WORKDIR /opt/workdir/telegram-mail-bot
+
+ENV TELEGRAM_TOKEN=
+
+CMD ["/bin/sh", "-c", "/usr/local/bin/python bot.py" ] \ No newline at end of file
diff --git a/bot.py b/bot.py
index 6e46411..b9c84b3 100644
--- a/bot.py
+++ b/bot.py
@@ -7,7 +7,7 @@ from utils.client import EmailClient
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s:%(lineno)d'
- ' - %(message)s', filename='/tmp/log/mailbot.log',
+ ' - %(message)s', filename='/var/log/mailbot.log',
level=logging.INFO)
logger = logging.getLogger(__name__)