-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (26 loc) · 954 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM nginx:alpine
LABEL maintainer="Yoan Tournade <[email protected]>"
ENV CTAN_RSYNC_MIRROR="rsync.dante.ctan.org/CTAN"
ENV SYNC_CRON_PERIOD="42 6,12,18,23 * * *"
ENV RANDOM_MODULO="179"
RUN apk add --no-cache \
rsync \
bash
# Add cron script(s).
RUN mkdir -p /app/crons
ADD cron/sync_mirror.sh /app/crons/sync_mirror.sh
# Give execution rights on the cron scripts.
RUN chmod 755 /app/crons/sync_mirror.sh
# Create directory for CTAN mirror data.
RUN mkdir -p /var/ctan_mirror
# Copy initial index.html (before synchronization).
ADD nginx/index.html /var/ctan_mirror/index.html
# Also put it in another directory so it can be copied
# at entrypoint when the directory is mounted (and thus empty).
ADD nginx/index.html /app/index.html
# Add custom Nginx conf.
ADD nginx/default.conf /etc/nginx/conf.d/default.conf
# Copy entrypoint script.
ADD entrypoint.sh /etc/entrypoint.sh
WORKDIR "/var/ctan_mirror"
CMD ["sh", "/etc/entrypoint.sh"]