gitea-pages/docker/local.dockerfile
djmil 2e11715194 Build release -vs- local sources
This commit closes #5

./docker/build.sh              # build local sources
./docker/build.sh -r 0.1.0 -p  # build known release
2024-08-25 18:05:41 +02:00

25 lines
830 B
Docker

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