mirror of
https://github.com/AgathaSorceress/mstdn-ebooks.git
synced 2024-11-20 03:25:53 +01:00
commit
c210eb6be1
14
Dockerfile
14
Dockerfile
@ -8,19 +8,17 @@ VOLUME /ebooks/data/
|
|||||||
RUN apk add --virtual .build-deps gcc musl-dev libffi-dev openssl-dev \
|
RUN apk add --virtual .build-deps gcc musl-dev libffi-dev openssl-dev \
|
||||||
&& pip install -r requirements.txt \
|
&& pip install -r requirements.txt \
|
||||||
&& apk del --purge .build-deps \
|
&& apk del --purge .build-deps \
|
||||||
|
&& apk add bash \
|
||||||
&& ln -s data/config.json . \
|
&& ln -s data/config.json . \
|
||||||
&& ln -s data/toots.db .
|
&& ln -s data/toots.db .
|
||||||
|
|
||||||
ADD *.py /ebooks/
|
ADD entrypoint.sh ./
|
||||||
|
RUN chmod +x entrypoint.sh
|
||||||
|
|
||||||
|
ADD *.py ./
|
||||||
|
|
||||||
ENV EBOOKS_SITE=https://botsin.space
|
ENV EBOOKS_SITE=https://botsin.space
|
||||||
ENV POST_TIMINGS="*/30 * * * *"
|
ENV POST_TIMINGS="*/30 * * * *"
|
||||||
ENV FETCH_TIMINGS="5 */2 * * *"
|
ENV FETCH_TIMINGS="5 */2 * * *"
|
||||||
|
|
||||||
RUN (echo "${POST_TIMINGS} cd /ebooks/ && python gen.py"; \
|
ENTRYPOINT [ "/ebooks/entrypoint.sh" ]
|
||||||
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
|
|
||||||
|
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