-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (38 loc) · 1.38 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Stage 1: Build frontend
FROM node:22-alpine AS frontend
WORKDIR /app/webui
COPY webui/package*.json ./
RUN npm ci
COPY webui/ ./
RUN npm run build
# Stage 2: Build Go binary
FROM golang:1.25-bookworm AS builder
ARG VERSION=dev
ARG GIT_SHA=unknown
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=frontend /app/webui/dist/ ./internal/app/coordinator/webui/static/
RUN CGO_ENABLED=1 go build -ldflags "-s -w -X github.com/strrl/wonder-mesh-net/cmd/wonder/commands.version=${VERSION} -X github.com/strrl/wonder-mesh-net/cmd/wonder/commands.gitSHA=${GIT_SHA}" -o /wonder ./cmd/wonder
# Stage 3: Runtime
FROM debian:bookworm
LABEL org.opencontainers.image.source="https://github.com/STRRL/wonder-mesh-net" \
org.opencontainers.image.url="https://github.com/STRRL/wonder-mesh-net" \
org.opencontainers.image.title="wonder-mesh-net" \
org.opencontainers.image.description="PaaS bootstrapper turning homelab/edge machines into BYO compute"
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tzdata \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /wonder /wonder
RUN mkdir -p /data/coordinator
EXPOSE 9080
VOLUME /data
WORKDIR /data
ENTRYPOINT ["/wonder"]
CMD ["coordinator"]