The applications tracker, leads inbox, email pipeline and capture userscript move here from web_server's backend, Python service and Vue app, as one Go binary that serves its own Vue SPA under /jobs/. - The Go services, resolvers and tests move over almost unchanged. - The three Claude calls are ported from Python to Go (internal/claude), with the same prompts, per-model request shaping and error messages. - There is no login: internal/auth asks the site backend's /auth/validate-admin with the visitor's cookies, and relays refreshed cookies back. - A Settings page replaces the admin-panel capture token card and adds the Microsoft sign-in link and a manual email sync. - The userscript is 2.0.0, at /jobs/, and migrates a saved API base. - Dockerfile, a standalone compose with Postgres, Makefile, and a Gitea CI workflow that tests and publishes the image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
47 lines
1.8 KiB
Docker
47 lines
1.8 KiB
Docker
# =============================================================================
|
|
# The job tracker: one image, one process. Three stages:
|
|
#
|
|
# web builds the Vue SPA (web/) with Vite. Only package*.json is copied
|
|
# before `npm ci`, so the dependency layer is cached across edits.
|
|
# build compiles the Go server. Same trick with go.mod/go.sum.
|
|
# runtime alpine with the binary and the built SPA, which the server serves
|
|
# from /app/static (STATIC_DIR) for every non-API path under /jobs/.
|
|
#
|
|
# The runtime runs as uid 1000, not root. DATA_DIR (/data) must be writable by
|
|
# it: with a bind mount, `chown 1000 <dir>` on the host. ca-certificates is
|
|
# for the outbound TLS (Claude, the job boards, Microsoft Graph, IMAP); wget
|
|
# is for the compose healthcheck.
|
|
#
|
|
# Multi-arch by construction: every base image is published for arm64, and
|
|
# the Pi builds natively.
|
|
# =============================================================================
|
|
FROM node:22-alpine AS web
|
|
WORKDIR /web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci --no-audit --no-fund
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
FROM golang:1.26 AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/jobtracker ./cmd/jobtracker
|
|
|
|
FROM alpine:3.22
|
|
RUN apk add --no-cache ca-certificates wget \
|
|
&& adduser -D -H -u 1000 app \
|
|
&& mkdir /data && chown app /data
|
|
COPY --from=build /out/jobtracker /app/jobtracker
|
|
COPY --from=web /web/dist /app/static
|
|
USER app
|
|
VOLUME /data
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://localhost:8080/jobs/api/health || exit 1
|
|
CMD ["/app/jobtracker"]
|