FROM caddy:2.8.4-builder-alpine AS builder # # mount root of the build context as /module/gitea-pages # inside the container and run `xcaddy build` command # also use cache to speed up subsequent builds # # $> go env GOCACHE <<-- Golang build cache # $> go env GOMODCACHE <<-- Goland module download cache # RUN --mount=type=bind,target=/module/gitea-pages \ --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg/mod \ xcaddy build \ --with gitea.djmil.dev/djmil/gitea-pages \ --replace gitea.djmil.dev/djmil/gitea-pages=/module/gitea-pages \ --replace gitea.djmil.dev/djmil/gitea-pages/pkg/gitea=/module/gitea-pages/pkg/gitea FROM caddy:2.8.4 COPY --from=builder /usr/bin/caddy /usr/bin/caddy COPY Caddyfile /etc/caddy/Caddyfile EXPOSE 3003/tcp