######### # BUILD # ######### FROM node:24-alpine AS build WORKDIR /app RUN apk add git # install pnpm ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable pnpm && corepack install -g pnpm@latest # dong web FROM build AS build-dong WORKDIR /app RUN git clone https://tangled.org/vielle.dev/dong-web.git /app/dong RUN pnpm --dir /app/dong install --prod RUN pnpm --dir /app/dong run build --outDir /app/dong/dist # saltire FROM build AS build-saltire WORKDIR /app RUN git clone https://tangled.org/vielle.dev/saltire-the-gays.git /app/saltire RUN pnpm --dir /app/saltire install --prod RUN pnpm --dir /app/saltire run build --outDir /app/saltire/dist ######### # CADDY # ######### FROM caddy:2.11.4-builder AS build-caddy RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ xcaddy build \ --with github.com/caddy-dns/porkbun@v0.3.1 ######## # MAIN # ######## FROM caddy:2.11.4 COPY --from=build-caddy /usr/bin/caddy /usr/bin/caddy # config COPY ./Caddyfile /etc/caddy/Caddyfile COPY ./caddy /etc/caddy/caddy # copy built files to /srv COPY ./srv /srv COPY --from=build-dong /app/dong/dist /srv/dong COPY --from=build-saltire /app/saltire/dist /srv/saltire CMD /usr/bin/caddy run --config /etc/caddy/Caddyfile --adapter caddyfile