diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2021-05-25 12:18:25 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2021-05-25 12:18:25 +0100 |
commit | 574635bf096f8cde0a7b825f300c326157e8e6ca (patch) | |
tree | c15fad21e24f5d749f6feb3c388846b928d71dcc | |
parent | d15a088591460e0af9a489721165ca84770d055b (diff) | |
download | yaoi-communism-574635bf096f8cde0a7b825f300c326157e8e6ca.tar.gz yaoi-communism-574635bf096f8cde0a7b825f300c326157e8e6ca.zip |
dockerised the program
-rw-r--r-- | Dockerfile | 10 | ||||
-rwxr-xr-x | bot.py | 2 | ||||
-rw-r--r-- | crontab | 1 | ||||
-rw-r--r-- | docker-compose.yml | 9 | ||||
-rwxr-xr-x | readme.md | 8 |
5 files changed, 29 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fb7d715 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM debian:latest +MAINTAINER Eden Attenborough "eddie.atten.ea29@gmail.com" +RUN apt-get update -y +RUN apt-get install -y tzdata python3-pip python-dev build-essential pkg-config cron +COPY . /app +WORKDIR /app +COPY crontab /etc/cron.d/oad-crontab +RUN chmod 0644 /etc/cron.d/oad-crontab && crontab /etc/cron.d/oad-crontab +RUN pip3 install -r requirements.txt +ENTRYPOINT ["cron", "-f"]
\ No newline at end of file @@ -1,5 +1,5 @@ import os
-os.chdir("/home/eden/yaoi-communism")
+os.chdir("/app")
from twython import Twython
import get_images
@@ -0,0 +1 @@ +0 */3 * * * python3 /app/bot.py
\ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..03b3bc7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' + +services: + cron: + build: + context: . + dockerfile: Dockerfile + image: jwansek/yaoi-communism + network_mode: host @@ -18,4 +18,12 @@ Designed to be run once an hour using a cron job. - `python3 bot.py`
+## running in docker
+
+- `sudo docker-compose build`
+
+- `sudo docker-compose up -d`
+
+Should do everything by itself if you set the config file correctly
+

|