Implement Phase 10: deployment (Dockerfile, systemd, install script)

- Multi-stage Dockerfile: golang:1.25-alpine builder, alpine:3.21 runtime
  CGO_ENABLED=0, stripped binary, non-root user
- systemd: service unit (hardened), backup oneshot, daily timer (02:00 UTC)
- Install script: create user, dirs, config, install units
- Updated PROGRESS.md with all completed phases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:01:40 -07:00
parent 169063cd00
commit 51dd5a6ca3
6 changed files with 151 additions and 4 deletions

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM golang:1.25-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /eng-pad-server ./cmd/eng-pad-server
FROM alpine:3.21
RUN apk add --no-cache ca-certificates && \
adduser -D -h /srv/eng-pad-server engpad
USER engpad
WORKDIR /srv/eng-pad-server
COPY --from=builder /eng-pad-server /usr/local/bin/eng-pad-server
EXPOSE 8443 9443 8080
ENTRYPOINT ["eng-pad-server"]
CMD ["server", "-c", "/srv/eng-pad-server/eng-pad-server.toml"]