From eda546cf6d8353ab5267e182067b5cb9524be91f Mon Sep 17 00:00:00 2001 From: linuro Date: Mon, 8 Jun 2020 21:40:29 +0200 Subject: [PATCH] Dockerify --- Dockerfile | 11 +++++++++++ docker-compose.yml | 4 ++++ files/crontab | 1 + main.py => files/main.py | 0 4 files changed, 16 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 files/crontab rename main.py => files/main.py (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f55d494 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM debian:buster + +RUN apt install -y python3 python3-requests cron + +ADD files/main.py /main.py + +ADD files/crontab /etc/cron.d/assembly-cron +RUN chmod 0644 /etc/cron.d/assembly-cron +RUN crontab /etc/cron.d/assembly-cron + +CMD ["cron", "-f"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..46a30fe --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,4 @@ +version: '2.0' +services: + assemblybot: + build: . diff --git a/files/crontab b/files/crontab new file mode 100644 index 0000000..16410a3 --- /dev/null +++ b/files/crontab @@ -0,0 +1 @@ +0 18 * * 4 /usr/bin/python3 /main.py diff --git a/main.py b/files/main.py similarity index 100% rename from main.py rename to files/main.py