Run the job tracker as its own container at /jobs/
Test and deploy / test (push) Successful in 2m3s
Test and deploy / deploy (push) Successful in 1m31s

The tracker (applications, leads, email pipeline, capture userscript) now
lives in the adamf/job-tracker repo and runs here from its published image.

- docker-compose.yml: a `jobs` service with an explicit environment list
  (its own database role; none of the site's other secrets), ./jobs-data
  mounted at /data, and nginx waiting for it. The dev override seeds it.
- nginx: /jobs/ proxied to it with the prefix kept, and 301s from
  /cv/jobs, /cv/leads and the old userscript URL.
- env_registry.json and .env.example: the email and job-lead variables now
  belong to the jobs service; CLAUDE_* to python and jobs; new
  POSTGRES_JOBS_* and JOBS_IMAGE_TAG. The compose environment test now
  checks the jobs service's list as well as python's.
- backend: no longer starts the email and job-lead schedulers or serves
  the capture and email routes, since the tracker reads the same settings
  and would otherwise process everything twice. The old job code stays
  until the tracker has run for a while.
- vue: the CV page's Jobs button goes to /jobs/; the old routes are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 17:08:18 +01:00
co-authored by Claude Opus 5.5
parent 148b94959d
commit 931b02c9e4
12 changed files with 208 additions and 102 deletions
+49
View File
@@ -114,6 +114,7 @@ services:
- silverbullet
- silverbullet-public
- python
- jobs
networks:
- app-network
ports:
@@ -424,6 +425,54 @@ services:
retries: 3
start_period: 10s
# The job application tracker, served at /jobs/. Built and published by its
# own repo (adamf/job-tracker on this Gitea), whose README covers the
# first-time database setup and the cutover from the old in-backend tracker.
#
# Like python, it gets an explicit `environment:` list rather than the whole
# .env: it never sees the site's database password or JWT secret, and has a
# database role of its own. backend/services/env_manager_test.go checks the
# list against env_registry.json.
#
# It has no login. AUTH_VALIDATE_URL is the backend's validate-admin route
# (the one nginx's auth_request uses), which the tracker asks with the
# visitor's cookies on each admin request.
#
# ./jobs-data holds the Microsoft Graph session and the capture token. The
# image runs as uid 1000, so the directory must be owned by it.
jobs:
image: adam-french.co.uk/adamf/job-tracker:${JOBS_IMAGE_TAG:-latest}
container_name: jobs
restart: always
depends_on:
db:
condition: service_healthy
networks:
- app-network
environment:
- DATABASE_URL=postgres://${POSTGRES_JOBS_USER:-jobs}:${POSTGRES_JOBS_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_JOBS_DB:-jobs}?sslmode=disable
- AUTH_VALIDATE_URL=http://${BACKEND_HOST}:${BACKEND_PORT}/auth/validate-admin
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
- CLAUDE_MODEL=${CLAUDE_MODEL:-}
- EMAIL_BACKEND=${EMAIL_BACKEND:-}
- EMAIL_SYNC_ENABLED=${EMAIL_SYNC_ENABLED:-}
- EMAIL_SYNC_INTERVAL=${EMAIL_SYNC_INTERVAL:-}
- MSGRAPH_CLIENT_ID=${MSGRAPH_CLIENT_ID:-}
- MSGRAPH_CLIENT_SECRET=${MSGRAPH_CLIENT_SECRET:-}
- MSGRAPH_TENANT_ID=${MSGRAPH_TENANT_ID:-}
- MSGRAPH_REDIRECT_URI=${MSGRAPH_REDIRECT_URI:-}
- IMAP_HOST=${IMAP_HOST:-}
- IMAP_PORT=${IMAP_PORT:-}
- IMAP_EMAIL=${IMAP_EMAIL:-}
- IMAP_PASSWORD=${IMAP_PASSWORD:-}
- JOB_LEADS_ENABLED=${JOB_LEADS_ENABLED:-}
- JOB_LEADS_INTERVAL=${JOB_LEADS_INTERVAL:-}
- ADZUNA_APP_ID=${ADZUNA_APP_ID:-}
- ADZUNA_APP_KEY=${ADZUNA_APP_KEY:-}
- REED_API_KEY=${REED_API_KEY:-}
volumes:
- ./jobs-data:/data
# Self-hosted git, served at /gitea/ and on port 3000 directly. Also the CI
# server: .gitea/workflows/deploy.yaml redeploys this whole stack on push to
# main, executed by the act_runner that lives outside docker (gitea-runner/).