2021-12-02 08:02:08 +00:00
|
|
|
FROM node:lts-alpine3.13@sha256:c7f8af31c7c4bb2221da18b67ccbe6d0632dab86d015573857b5a91afbedcf8c
|
2020-05-31 19:43:54 +00:00
|
|
|
|
2020-12-20 21:47:45 +00:00
|
|
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
|
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
|
|
LABEL org.opencontainers.image.title="link-validator"
|
|
|
|
LABEL org.opencontainers.image.url="https://gitea.rknet.org/docker/link-validator"
|
|
|
|
LABEL org.opencontainers.image.source="https://gitea.rknet.org/docker/link-validator"
|
|
|
|
LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/docker/link-validator"
|
2020-05-31 19:43:54 +00:00
|
|
|
|
2020-10-18 19:51:50 +00:00
|
|
|
ARG BUILD_VERSION
|
|
|
|
# renovate: datasource=npm depName=broken-link-checker
|
|
|
|
ENV BLC_VERSION="${BUILD_VERSION:-0.7.8}"
|
2020-12-30 17:46:58 +00:00
|
|
|
# renovate: datasource=github-releases depName=caddyserver/caddy
|
2021-11-09 19:18:31 +00:00
|
|
|
ENV CADDY_VERSION="${CADDY_VERSION:-v2.4.6}"
|
2020-05-31 19:43:54 +00:00
|
|
|
|
2020-10-18 19:51:50 +00:00
|
|
|
ENV LINK_VALIDATOR_BASE_DIR=/drone/src \
|
2020-06-01 19:54:09 +00:00
|
|
|
LINK_VALIDATOR_SERVER_PORT=80 \
|
2020-05-31 19:43:54 +00:00
|
|
|
FORCE_COLOR=true \
|
|
|
|
NPM_CONFIG_LOGLEVEL=error
|
|
|
|
|
|
|
|
COPY overlay/ /
|
|
|
|
|
|
|
|
RUN echo "Installing requirements ..." && \
|
2020-12-30 17:46:58 +00:00
|
|
|
apk --update add --virtual .build-deps curl && \
|
|
|
|
curl -sSL "https://github.com/caddyserver/caddy/releases/download/${CADDY_VERSION}/caddy_${CADDY_VERSION##v}_linux_amd64.tar.gz" | tar xz -C /usr/local/bin caddy && \
|
|
|
|
chmod 755 /usr/local/bin/caddy && \
|
2020-05-31 19:43:54 +00:00
|
|
|
BLC_VERSION="${BLC_VERSION##v}" && \
|
|
|
|
BLC_MAJOR="${BLC_VERSION%%.*}" && \
|
|
|
|
if [ -z "${BLC_MAJOR//[0-9]}" ] && [ -n "$BLC_MAJOR" ]; then \
|
|
|
|
echo "Installing link-checker version '$BLC_VERSION' ..." && \
|
|
|
|
npm install -g broken-link-checker@"$BLC_VERSION"; \
|
|
|
|
else \
|
|
|
|
echo "Installing latest link-checker ..." && \
|
|
|
|
npm install -g broken-link-checker; \
|
|
|
|
fi && \
|
2020-12-30 17:46:58 +00:00
|
|
|
apk del .build-deps && \
|
2020-05-31 19:43:54 +00:00
|
|
|
rm -rf /var/cache/apk/* && \
|
|
|
|
rm -rf /tmp/*
|
|
|
|
|
|
|
|
USER root
|
|
|
|
CMD []
|
|
|
|
ENTRYPOINT ["/bin/link-validator"]
|