mirror of
https://github.com/n30nex/CartoLite-Server.git
synced 2026-10-16 11:39:52 +00:00
* Add shared visual controls and native prebuilt worldwide Docker releases * Validate shared styles, synthetic buildings, and date-line-safe packet geometry * Document the release and bound decorative work in dense route views * Remove the retired terrain-history collection cache * Address review feedback on terrain updates, legends, and responsive buildings * Keep the region and packet legends separate on compact screens * Separate building, camera, and responsive browser checks * Wait for the complete synthetic snapshot before upgrade checks
51 lines
2.0 KiB
Docker
51 lines
2.0 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS web-build
|
|
WORKDIR /src/web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci
|
|
COPY web/ ./
|
|
# Published images contain no operator or CI browser credentials.
|
|
RUN npm run build
|
|
|
|
FROM --platform=$BUILDPLATFORM golang:1.25.13-bookworm AS go-build
|
|
ARG APP_VERSION=dev
|
|
ARG GIT_SHA=unknown
|
|
ARG BUILD_TIME=unknown
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
WORKDIR /src
|
|
COPY backend/go.mod backend/go.sum ./backend/
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
cd backend && go mod download && go mod verify
|
|
COPY backend/ ./backend/
|
|
COPY --from=web-build /src/web/dist/ ./backend/internal/httpapi/static/
|
|
RUN install -d -m 0750 -o 65532 -g 65532 /tmp/cartolite-data
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
cd backend && CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build \
|
|
-trimpath \
|
|
-ldflags="-s -w -X main.version=${APP_VERSION} -X main.gitSHA=${GIT_SHA}" \
|
|
-o /out/cartolite ./cmd/cartolite
|
|
|
|
FROM scratch
|
|
ARG APP_VERSION=dev
|
|
ARG GIT_SHA=unknown
|
|
ARG BUILD_TIME=unknown
|
|
LABEL org.opencontainers.image.title="CartoLite Server" \
|
|
org.opencontainers.image.description="Self-hosted privacy-safe live MeshCore traffic map" \
|
|
org.opencontainers.image.source="https://github.com/n30nex/CartoLite-Server" \
|
|
org.opencontainers.image.version="${APP_VERSION}" \
|
|
org.opencontainers.image.revision="${GIT_SHA}" \
|
|
org.opencontainers.image.created="${BUILD_TIME}" \
|
|
org.opencontainers.image.licenses="MIT"
|
|
COPY --from=go-build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
COPY --from=go-build --chown=65532:65532 /tmp/cartolite-data /data
|
|
COPY --from=go-build /out/cartolite /cartolite
|
|
USER 65532:65532
|
|
EXPOSE 8080
|
|
VOLUME ["/data"]
|
|
HEALTHCHECK --interval=20s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD ["/cartolite", "healthcheck", "http://127.0.0.1:8080/healthz"]
|
|
ENTRYPOINT ["/cartolite"]
|