2025-01-12 13:54:15 +01:00
|
|
|
# builder
|
2025-01-12 14:01:15 +01:00
|
|
|
FROM hugomods/hugo:base-non-root AS builder
|
2025-01-12 00:07:27 +01:00
|
|
|
ARG BASE_URL ""
|
2025-01-13 12:50:24 +01:00
|
|
|
ARG RELEASETAG "unset"
|
2025-01-13 11:40:03 +01:00
|
|
|
# --chown is required since kaniko in woodpecker otherwise copies as root and
|
|
|
|
# the hugo command below fails since it is executed as hugo
|
2025-01-13 11:34:36 +01:00
|
|
|
COPY --chown=hugo:hugo content/ /src
|
2025-01-13 12:50:24 +01:00
|
|
|
RUN sed -i 's/%RELEASETAG%/'${RELEASETAG}'/' /src/content/about.md
|
2025-01-12 00:07:27 +01:00
|
|
|
RUN if [ "$BASE_URL" = ""]; then hugo; else hugo -b $BASE_URL; fi
|
2025-01-11 18:46:41 +01:00
|
|
|
|
2025-01-12 13:54:15 +01:00
|
|
|
# server
|
2025-01-12 00:00:00 +01:00
|
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /src/public /usr/share/nginx/html
|
2025-01-12 13:54:15 +01:00
|
|
|
RUN \
|
|
|
|
chown -R nobody:nobody /var/cache/nginx /var/log/nginx && \
|
|
|
|
sed -i 's/listen\s\+80;/listen 8080;/' /etc/nginx/conf.d/default.conf && \
|
|
|
|
sed -i 's,pid\s\+/var/run/nginx.pid;,pid /tmp/nginx.pid;,' /etc/nginx/nginx.conf
|
|
|
|
USER nobody
|
|
|
|
EXPOSE 8080
|
2025-01-12 00:00:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|