41 lines
1.4 KiB
Docker
41 lines
1.4 KiB
Docker
FROM alpine:3.18
|
|
|
|
MAINTAINER Yazzi Huseh
|
|
ENV TZ=Asia/Shanghai PUID=1000 PGID=100
|
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
|
&& apk --update add --no-cache \
|
|
shadow \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
RUN set -eux; BINARY_URL=https://github.com/just-containers/skaware/releases/download/v2.0.7/s6-2.11.0.0-linux-amd64-bin.tar.gz; \
|
|
wget -O /tmp/s6.tar.gz ${BINARY_URL}; \
|
|
tar -xzf /tmp/s6.tar.gz -C /;
|
|
|
|
COPY --chmod=0755 entrypoint.sh /entrypoint.sh
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
# install all required apks
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
|
&& apk --update add --no-cache \
|
|
nginx \
|
|
nginx-mod-http-fancyindex \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# install fancyindex theme
|
|
RUN set -eux; BINARY_URL=https://code.simaek.com/xueye/nginx-fancyindex-theme/archive/v1.0.0.tar.gz; \
|
|
wget -O /tmp/theme.tar.gz ${BINARY_URL}; \
|
|
mkdir -p /fancyindex; \
|
|
tar -xzf /tmp/theme.tar.gz -C /fancyindex --strip-components=1 --no-same-owner; \
|
|
rm -f /tmp/theme.tar.gz;
|
|
|
|
#
|
|
RUN adduser -u $PUID -D -s /sbin/nologin -h /public -g "share user" public
|
|
|
|
COPY nginx/default.conf /etc/nginx/http.d/default.conf
|
|
COPY --chmod=0755 /bin/markdown-renderer /bin/markdown-renderer
|
|
COPY --chmod=0755 services.d/markdown-renderer/run /etc/services.d/nginx/run
|
|
COPY --chmod=0755 services.d/nginx/run /etc/services.d/markdown-renderer/run
|
|
COPY --chmod=0755 init.sh /init.sh
|
|
|
|
CMD ["/init.sh"] |