Files
Homer/Dockerfile

59 lines
1.7 KiB
Docker
Raw Normal View History

# build stage
2025-02-22 16:07:40 +01:00
FROM --platform=$BUILDPLATFORM node:22-alpine3.21 AS build-stage
2024-04-22 19:55:25 +02:00
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
2024-11-11 17:17:11 +01:00
2025-02-22 16:07:40 +01:00
RUN corepack enable && corepack use pnpm@10
WORKDIR /app
2024-04-22 19:55:25 +02:00
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
2024-04-22 19:55:25 +02:00
RUN pnpm build
# production stage
2025-02-22 16:07:40 +01:00
FROM alpine:3.21
2020-01-21 21:29:57 +01:00
ARG VERSION_TAG=latest
LABEL \
org.label-schema.schema-version="1.0" \
org.label-schema.version="$VERSION_TAG" \
org.opencontainers.image.title="Homer Image" \
2025-01-08 12:15:46 +01:00
org.opencontainers.image.description="A dead simple static Home-Page for your server to keep your services on hand, from a simple yaml configuration file." \
org.opencontainers.image.ref.name="b4bz/homer:${VERSION_TAG}" \
org.opencontainers.image.version="$VERSION_TAG" \
org.opencontainers.image.licenses="Apache-2.0 license" \
org.opencontainers.image.source="https://github.com/bastienwirtz/homer" \
org.opencontainers.image.url="https://hub.docker.com/r/b4bz/homer"
2024-11-11 17:17:11 +01:00
ENV GID=1000 \
UID=1000 \
PORT=8080 \
SUBFOLDER="/_" \
INIT_ASSETS=1 \
IPV6_DISABLE=0
2020-01-21 21:29:57 +01:00
RUN addgroup -S lighttpd -g ${GID} && adduser -D -S -u ${UID} lighttpd lighttpd && \
apk add -U --no-cache tzdata lighttpd
2020-01-21 21:29:57 +01:00
WORKDIR /www
COPY lighttpd.conf /lighttpd.conf
COPY lighttpd-ipv6.sh /etc/lighttpd/ipv6.sh
COPY entrypoint.sh /entrypoint.sh
COPY --from=build-stage --chown=${UID}:${GID} /app/dist /www/
2022-04-30 15:58:04 +02:00
COPY --from=build-stage --chown=${UID}:${GID} /app/dist/assets /www/default-assets
USER ${UID}:${GID}
2025-01-06 22:25:36 +00:00
HEALTHCHECK --start-period=10s --start-interval=1s --interval=30s --timeout=5s --retries=3 \
CMD wget --no-verbose -Y off --tries=1 --spider http://127.0.0.1:${PORT}/ || exit 1
2021-08-15 15:34:17 +02:00
2020-06-12 17:50:07 +01:00
EXPOSE ${PORT}
2020-06-12 17:50:07 +01:00
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]