docker-compose.yml (2024B)
1 # deploy/worker/docker-compose.yml - a worker on your own machine 2 # 3 # For contributing build capacity to a conductor run by someone else. The 4 # worker needs no inbound connectivity, so this works from behind NAT. 5 # 6 # Setup: 7 # 1. Ask for a worker token, or mint one yourself in the interface under 8 # Workers. It is shown once. 9 # 2. Put it in .env next to this file: 10 # CONDUCTOR_URL=https://ci.example.com 11 # CONDUCTOR_WORKER_TOKEN=... 12 # 3. docker compose up -d && docker compose logs -f 13 # 14 # A worker you register is only ever offered jobs from your own projects. 15 # 16 # Jobs run as sibling containers on this host's docker daemon. They are 17 # isolated from each other, but a job is code from a repository running on 18 # your machine: only point this at a conductor whose projects you are 19 # willing to execute. 20 21 name: conductor-worker 22 23 services: 24 worker: 25 image: "${CONDUCTOR_WORKER_IMAGE:-finwo/conductor-worker:latest}" 26 restart: unless-stopped 27 environment: 28 CONDUCTOR_URL: "${CONDUCTOR_URL:?set CONDUCTOR_URL in .env}" 29 CONDUCTOR_WORKER_TOKEN: "${CONDUCTOR_WORKER_TOKEN:?set CONDUCTOR_WORKER_TOKEN in .env}" 30 CONDUCTOR_WORKER_NAME: "${CONDUCTOR_WORKER_NAME:-}" 31 # Architectures this machine can build for. Leave unset to take only 32 # jobs that declare none. 33 CONDUCTOR_WORKER_ARCHES: "${CONDUCTOR_WORKER_ARCHES:-}" 34 CONDUCTOR_WORKER_CONCURRENCY: "${CONDUCTOR_WORKER_CONCURRENCY:-1}" 35 volumes: 36 # The socket is all it needs. A job's tree is unpacked into the 37 # job's own container over this socket, and its artifacts are read 38 # back the same way, so the worker keeps nothing between jobs and 39 # shares no directory with what it runs. 40 - /var/run/docker.sock:/var/run/docker.sock 41 # Features are declared in a config file when a job needs something 42 # from this machine, such as a signing key. See docs/worker.md. 43 # - ./worker.json:/etc/conductor/worker.json:ro 44 # - /srv/keys/build.rsa:/srv/keys/build.rsa:ro