mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 15:51:26 +00:00
- `containr nodes add <user@host>` mints an enroll token, SSHes once,
runs the install script remotely; --print emits the one-liner
- Public /api/agents/install.sh + /api/agents/download/{platform};
agent binaries built into the image under /agents
- Agent-side `prune` (bounded docker system prune, volumes opt-in)
and `system_df` commands
- node_agents.auto_prune + health sweep enqueues daily prune;
offline/online transitions notify admins
- CLI nodes update/prune/commands + MCP tools (prune confirm-gated)
- Usage page: install one-liner, per-node Prune + auto toggle
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
55 lines
1.4 KiB
Docker
55 lines
1.4 KiB
Docker
# Build Go API binary
|
|
FROM golang:1.26-alpine AS go-builder
|
|
|
|
RUN apk add --no-cache git ca-certificates tzdata
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
ARG VERSION=dev
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo \
|
|
-ldflags "-X containr/internal/api.Version=${VERSION}" -o main cmd/server/main.go
|
|
|
|
# Node-agent binaries served by the API for SSH/bootstrap installs.
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /agents/containr-agent-linux-amd64 ./cmd/agent && \
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /agents/containr-agent-linux-arm64 ./cmd/agent
|
|
|
|
# Build embedded Better Auth runtime dependencies
|
|
FROM node:22-alpine AS auth-builder
|
|
|
|
WORKDIR /auth
|
|
|
|
COPY auth/package*.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY auth/src ./src
|
|
|
|
# Final runtime image (Go API + Better Auth sidecar in one container)
|
|
FROM node:22-alpine
|
|
|
|
RUN apk --no-cache add ca-certificates tzdata wget
|
|
|
|
RUN addgroup -g 1001 -S appgroup && \
|
|
adduser -u 1001 -S appuser -G appgroup
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=go-builder /app/main ./main
|
|
COPY --from=go-builder /app/migrations_goose ./migrations_goose
|
|
COPY --from=go-builder /agents /agents
|
|
COPY --from=auth-builder /auth ./auth
|
|
|
|
RUN chown -R appuser:appgroup /app
|
|
|
|
USER appuser
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8080/health || exit 1
|
|
|
|
CMD ["./main"]
|