2020-05-25 15:07:03 -07:00
# 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
2020-05-25 15:07:03 -07:00
WORKDIR /app
2024-04-22 19:55:25 +02:00
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
2020-05-25 15:07:03 -07:00
COPY . .
2024-04-22 19:55:25 +02:00
RUN pnpm build
2020-05-25 15:07:03 -07:00
# production stage
2025-02-22 16:07:40 +01:00
FROM alpine:3.21
2020-01-21 21:29:57 +01:00
2025-02-28 12:17:01 +01:00
ARG VERSION_TAG = latest
2025-02-28 10:09:14 +01:00
2025-01-08 12:14:07 +01:00
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." \
2025-02-25 14:03:18 +01:00
org.opencontainers.image.ref.name= " b4bz/homer: ${ VERSION_TAG } " \
2025-01-08 12:14:07 +01:00
org.opencontainers.image.version= " $VERSION_TAG " \
org.opencontainers.image.licenses= "Apache-2.0 license" \
org.opencontainers.image.source= "https://github.com/bastienwirtz/homer" \
2025-02-25 14:03:18 +01:00
org.opencontainers.image.url= "https://hub.docker.com/r/b4bz/homer"
2025-01-08 12:14:07 +01:00
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
2022-04-10 11:55:11 +02:00
RUN addgroup -S lighttpd -g ${ GID } && adduser -D -S -u ${ UID } lighttpd lighttpd && \
2024-11-12 18:06:58 +01:00
apk add -U --no-cache tzdata lighttpd
2020-01-21 21:29:57 +01:00
2022-04-10 11:55:11 +02:00
WORKDIR /www
2020-06-11 11:32:24 +10:00
2022-04-10 11:55:11 +02:00
COPY lighttpd.conf /lighttpd.conf
2023-09-25 20:15:31 -04:00
COPY lighttpd-ipv6.sh /etc/lighttpd/ipv6.sh
2022-04-10 11:55:11 +02:00
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
2022-04-10 11:55:11 +02:00
USER ${UID}:${GID }
2025-01-06 22:25:36 +00:00
HEALTHCHECK --start-period= 10s --start-interval= 1s --interval= 30s --timeout= 5s --retries= 3 \
2025-02-25 21:46:38 +01:00
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 }
2022-04-10 11:55:11 +02:00
2020-06-12 17:50:07 +01:00
ENTRYPOINT [ "/bin/sh" , "/entrypoint.sh" ]