2023-05-26 19:21:35 +08:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
|
|
|
|
&& sed -i 'a https://mirrors.tuna.tsinghua.edu.cn/alpine/edge/testing' /etc/apk/repositories \
|
2023-07-09 18:59:02 +08:00
|
|
|
&& apk add --no-cache gmid git python3 perl \
|
2023-06-27 11:39:39 +08:00
|
|
|
&& touch /var/log/git.log \
|
|
|
|
&& echo "0 * * * * run-parts /etc/periodic/hourly" > /var/spool/cron/crontabs/root
|
2023-05-26 19:21:35 +08:00
|
|
|
|
2023-06-07 11:47:06 +08:00
|
|
|
RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1 \
|
2023-06-27 11:39:39 +08:00
|
|
|
&& cd dongdigua.github.io \
|
|
|
|
&& git config filter.dater.smudge 'perl -pe "\$last_date = `git log --pretty=format:\\"%ad\\" -1`;s/\\\$Date\\\$/\\\$Date: \$last_date\\\$/"' \
|
2023-06-27 13:47:08 +08:00
|
|
|
&& git config filter.dater.clean 'perl -pe "s/\\\$Date[^\\\$]*\\\$/\\\$Date\\\$/"'
|
2023-05-26 19:21:35 +08:00
|
|
|
|
|
|
|
COPY run-wrapper.sh .
|
2023-06-27 13:47:08 +08:00
|
|
|
COPY gmid.conf /dongdigua.github.io/gmi/docker/
|
2023-06-07 20:34:10 +08:00
|
|
|
COPY update-git.sh /etc/periodic/hourly/
|
2023-06-27 15:27:08 +08:00
|
|
|
COPY cgi/* /dongdigua.github.io/cgi/
|
2023-05-26 19:21:35 +08:00
|
|
|
|
2023-05-29 11:18:04 +08:00
|
|
|
# for testing purpose only
|
|
|
|
# RUN mkdir /etc/periodic/1min \
|
|
|
|
# && echo "*/1 * * * * run-parts /etc/periodic/1min" \
|
|
|
|
# >> /var/spool/cron/crontabs/root
|
|
|
|
# COPY update-git.sh /etc/periodic/1min/
|
|
|
|
|
2023-05-26 19:21:35 +08:00
|
|
|
CMD [ "./run-wrapper.sh" ]
|