deployment/compose/README.md
With the docker-compose snippets within this directory you are able to plug
different setups of Semaphore UI together. Below you can find some example
combinations.
Some of the snippets define environment variables which could be optionally overwritten if needed.
First of all we need the server definition and we need to decide if we want to build the image dynamically or if we just want to use a released image.
This simply takes the currently cloned source and builds a new image including all local changes.
docker-compose -f deployment/compose/server/base.yml -f deployment/compose/server/build.yml up
This simply downloads the defined image from DockerHub and starts/configures it properly based on the integrated bootstrapping scripts.
docker-compose -f deployment/compose/server/base.yml -f deployment/compose/server/image.yml up
If you want to provide a custom config.json file to add options which are not
exposed as environment variables you could add this snippet which sources the
file from the current working directory.
docker-compose <server from above> -f deployment/compose/server/config.yml up
If you want to try the remote runner functionality of Semaphore you could just add this snippet to get a runner up and connected to semaphore. Similar to the examples above for the server you got different options like building the runner from the source or using our prebuilt images.
Runners connect to the server in one of two ways:
Global registration token — set runner_registration_token in the server config
(or use the token shown in Admin → Runners). The runner process presents this
token on first connect and receives a long-lived auth token in return.
Per-runner registration token (smrs_…) — create an unregistered runner in the
UI (uncheck "Registered") or via the API with "registered": false. Generate a
one-time registration token for that runner and pass it to semaphore runner register.
This mode is useful for Terraform-provisioned infrastructure where each host gets its
own token. Tokens expire after one hour; regenerate from the UI if needed.
A runner is considered registered when it has an auth token (runner.token in the
database). Unregistered runners appear in the UI with a filter and cannot pick up tasks
until registration completes.
This simply takes the currently cloned source and builds a new image including all local changes.
docker-compose <server from above> -f deployment/compose/runner/base.yml -f deployment/compose/runner/build.yml up
This simply downloads the defined image from DockerHub and starts/configures it properly based on the integrated bootstrapping scripts.
docker-compose <server from above> -f deployment/compose/runner/base.yml -f deployment/compose/runner/image.yml up
If you want to provide a custom config.json file to add options which are not
exposed as environment variables you could add this snippet which sources the
file from the current working directory.
docker-compose <runner from above> -f deployment/compose/runner/config.yml up
After deciding the base of it you should choose one of the supported databases. Here we got currently the following options so far.
This simply configures a named volume for the SQLite storage used as a database backend.
docker-compose <server/runner from above> -f deployment/compose/store/sqlite.yml up
This simply configures a named volume for the SQLite storage used as a database backend.
docker-compose <server/runner from above> -f deployment/compose/store/sqlite.yml up
This simply starts an additional container for a MariaDB instance used as a database backend including the required credentials.
docker-compose <server/runner from above> -f deployment/compose/store/mariadb.yml up
This simply starts an additional container for a MySQL instance used as a database backend including the required credentials.
docker-compose <server/runner from above> -f deployment/compose/store/mysql.yml up
This simply starts an additional container for a PostgreSQL instance used as a database backend including the required credentials.
docker-compose <server/runner from above> -f deployment/compose/store/postgres.yml up
After playing with the setup you are able to stop the whole setup by just
replacing up at the end of the command with down.