Containerfile
⎇
Raw
1FROM golang:1.27 AS builder
2WORKDIR /src
3COPY go.mod go.sum ./
4RUN go mod download
5COPY . .
6RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /hearthforge ./cmd/hearthforge
7
8FROM debian:trixie-slim
9RUN apt-get update && apt-get install -y --no-install-recommends \
10 tini openssh-client git-core ca-certificates \
11 && rm -rf /var/lib/apt/lists/*
12COPY --from=builder /hearthforge /usr/local/bin/hearthforge
13
14EXPOSE 3000 2222
15ENV DATA_DIR=/data
16VOLUME ["/data"]
17
18ENTRYPOINT ["/usr/bin/tini", "--"]
19CMD ["sh", "-c", "hearthforge init && hearthforge"]
20