mirror of
https://github.com/AgathaSorceress/mstdn-ebooks.git
synced 2024-11-20 03:25:53 +01:00
contain your coffee
This commit is contained in:
parent
c93a67e219
commit
efd8d30b4f
19
Dockerfile
19
Dockerfile
@ -6,21 +6,16 @@ WORKDIR /ebooks/
|
||||
VOLUME /ebooks/data/
|
||||
|
||||
RUN apk add --virtual .build-deps gcc musl-dev libffi-dev openssl-dev \
|
||||
&& pip install -r requirements.txt \
|
||||
&& apk del --purge .build-deps \
|
||||
&& ln -s data/config.json . \
|
||||
&& ln -s data/toots.db .
|
||||
&& pip install -r requirements.txt \
|
||||
&& apk del --purge .build-deps \
|
||||
&& ln -s data/config.json . \
|
||||
&& ln -s data/toots.db .
|
||||
|
||||
ADD *.py /ebooks/
|
||||
ADD entrypoint.sh ./
|
||||
ADD *.py ./
|
||||
|
||||
ENV EBOOKS_SITE=https://botsin.space
|
||||
ENV POST_TIMINGS="*/30 * * * *"
|
||||
ENV FETCH_TIMINGS="5 */2 * * *"
|
||||
|
||||
RUN (echo "${POST_TIMINGS} cd /ebooks/ && python gen.py"; \
|
||||
echo "${FETCH_TIMINGS} cd /ebooks/ && python main.py"; \
|
||||
echo "@reboot cd /ebooks/ && python reply.py") | crontab -
|
||||
|
||||
CMD (test -f data/config.json || echo "{\"site\":\"${EBOOKS_SITE}\"}" > data/config.json) \
|
||||
&& (test -f data/toots.db || (python main.py && exit)) \
|
||||
&& exec crond -f -L /dev/stdout
|
||||
ENTRYPOINT [ "/ebooks/entrypoint.sh" ]
|
||||
|
13
entrypoint.sh
Normal file
13
entrypoint.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xe
|
||||
|
||||
(echo "${POST_TIMINGS} cd /ebooks/ && python gen.py"; \
|
||||
echo "${FETCH_TIMINGS} cd /ebooks/ && python main.py"; \
|
||||
echo "@reboot cd /ebooks/ && python reply.py") | crontab -
|
||||
|
||||
test -f data/config.json || echo "{\"site\":\"${EBOOKS_SITE}\"}" > data/config.json
|
||||
|
||||
test -f data/toots.db || (python main.py && exit)
|
||||
|
||||
exec crond -f -L /dev/stdout
|
Loading…
Reference in New Issue
Block a user