tweet-toot/Dockerfile

27 lines
843 B
Docker
Raw Permalink Normal View History

2018-09-24 05:07:58 +02:00
# Docker image for Tweet-Toot project.
FROM ubuntu
MAINTAINER ayushsharma.22+tweettoot@gmail.com
ARG mastodon_token
RUN cd /root;\
apt-get -y update;\
apt-get -y upgrade;\
2018-09-27 03:53:02 +02:00
apt-get -y install python3 python3-pip git wget cron rsyslog;\
2018-09-24 05:07:58 +02:00
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 install python3-idna;\
2018-09-24 05:07:58 +02:00
apt-get -y autoremove;\
apt-get -y autoclean;\
# Configure Tweet-Toot
2018-09-27 03:53:02 +02:00
sed -i 's/"toots.app_secure_token": ""/"toots.app_secure_token": "'$mastodon_token'"/g' config.json;\
2018-09-24 05:07:58 +02:00
RUN crontab -l > /tmp/crontab;\
2018-11-11 11:34:11 +01:00
echo '* * * * * cd /root/tweet-toot; python3 /root/tweet-toot/run.py >> /tmp/tweet-toot.log 2>&1' >> /tmp/crontab;\
2018-09-24 11:38:33 +02:00
crontab /tmp/crontab
RUN touch /tmp/tweet-toot.log
2018-11-11 11:17:05 +01:00
CMD cron && tail -f /tmp/tweet-toot.log