From cdac50215a61d8af3242fe33111d63824901b8a0 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Mon, 24 Sep 2018 08:37:58 +0530 Subject: [PATCH] Adding Dockerfile --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f2511a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Docker image for Tweet-Toot project. +FROM ubuntu +MAINTAINER ayushsharma.22+tweettoot@gmail.com + +ARG mastodon_token +ARG papertrail_token + +RUN cd /root;\ + apt-get -y update;\ + apt-get -y upgrade;\ + apt-get -y install python3 python3-pip git wget cron;\ + git clone https://github.com/ayush-sharma/tweet-toot.git;\ + cd tweet-toot;\ + pip3 install -r requirements.txt;\ + apt-get -y purge python3-pip git;\ + apt-get -y autoremove;\ + apt-get -y autoclean;\ + # Configure Tweet-Toot + sed -i 's/"toots.app_secure_token": ""/"toots.app_secure_token": "'$mastodon_token'"/g' config.json + +# Install Papertrail agent +RUN wget -qO - --header="X-Papertrail-Token: "$papertrail_token https://papertrailapp.com/destinations/10693082/setup.sh | bash;\ + wget -qO - https://github.com/papertrail/remote_syslog2/releases/download/v0.20/remote-syslog2_0.20_amd64.deb;\ + dpkg -i remote-syslog2_0.20_amd64.deb;\ + remote_syslog \ + -p 22420 \ + -d logs7.papertrailapp.com \ + --pid-file=/var/run/remote_syslog.pid \ + /tmp/tweet-toot.log;\ + apt-get -y purge wget + +RUN my_pwd=`pwd`;\ + crontab -l > /tmp/crontab;\ + echo '* * * * * python3 '$my_pwd'/run.py >> /tmp/tweet-toot.log' >> /tmp/crontab;\ + crontab /tmp/crontab \ No newline at end of file