feat: speed up docker build

This commit is contained in:
Aarnav Tale
2025-06-22 16:59:21 -04:00
parent 87b8d64bcc
commit 2bf088b4a9
3 changed files with 15 additions and 4 deletions
+1
View File
@@ -9,6 +9,7 @@
- You may need to run `chown -R 65532:65532 <host_path>` on your data directory to ensure the container can write to it.
- Removing a Split DNS record will no longer make the split domain unresolvable by clients (closes [#231](https://github.com/tale/headplane/issues/231)).
- Reintroduce the toggle for overriding local DNS settings in the Headscale config (closes [#236](https://github.com/tale/headplane/issues/236)).
- Prefer cross-compiling in the Dockerfile to speed up builds while still supporting multiple architectures.
### 0.6.0 (May 25, 2025)
- Headplane 0.6.0 now requires **Headscale 0.26.0** or newer.
+10 -4
View File
@@ -1,17 +1,23 @@
FROM jdxcode/mise:latest AS mise-context
FROM --platform=$BUILDPLATFORM jdxcode/mise:latest AS mise-context
COPY mise.toml .
RUN mise install
FROM mise-context AS go-build
FROM --platform=$BUILDPLATFORM mise-context AS go-build
WORKDIR /build/
COPY go.mod go.sum ./
COPY cmd/ ./cmd/
COPY internal/ ./internal/
RUN mkdir -p /build/app/ && mise run wasm ::: agent
ARG TARGETOS
ARG TARGETARCH
RUN mkdir -p /build/app/ && \
GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 \
mise run wasm ::: agent
RUN chmod +x /build/build/hp_agent
FROM mise-context AS js-build
FROM --platform=$BUILDPLATFORM mise-context AS js-build
WORKDIR /build
COPY patches ./patches
COPY package.json pnpm-lock.yaml ./
+4
View File
@@ -85,6 +85,10 @@
"patchedDependencies": {
"react-router-hono-server": "patches/react-router-hono-server.patch"
},
"supportedArchitectures": {
"os": ["current", "linux"],
"cpu": ["x64", "arm64"]
},
"onlyBuiltDependencies": [
"@biomejs/biome",
"better-sqlite3",