14 行
691 B
Docker
14 行
691 B
Docker
FROM alpine:3.23 AS build
|
|
RUN apk add --no-cache hugo tzdata rsvg-convert font-noto-cjk
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN hugo --minify --destination /public \
|
|
&& find /public -name ogp.svg | while read -r card; do rsvg-convert --width 1200 --height 630 --output "${card%.svg}.png" "$card" && rm "$card"; done \
|
|
&& test -z "$(find /public -name ogp.svg)" \
|
|
&& test -s /public/ogp.png && test -s /public/pnl/ogp.png
|
|
|
|
FROM nginxinc/nginx-unprivileged:1.30.6-alpine
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /public /usr/share/nginx/html
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1:8080/robots.txt || exit 1
|