mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
docs: add all snippets for docker-compose deployments
This commit is contained in:
parent
377048f6ed
commit
f0026b3134
131
deployment/compose/README.md
Normal file
131
deployment/compose/README.md
Normal file
@ -0,0 +1,131 @@
|
||||
# Compose
|
||||
|
||||
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.
|
||||
|
||||
## Server
|
||||
|
||||
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.
|
||||
|
||||
### Build
|
||||
|
||||
This simply takes the currently cloned source and builds a new image including
|
||||
all local changes.
|
||||
|
||||
```console
|
||||
docker-compose -f deployment/compose/server/base.yml -f deployment/compose/server/build.yml up
|
||||
```
|
||||
|
||||
### Image
|
||||
|
||||
This simply downloads the defined image from DockerHub and starts/configures it
|
||||
properly based on the integrated bootstrapping scripts.
|
||||
|
||||
```console
|
||||
docker-compose -f deployment/compose/server/base.yml -f deployment/compose/server/image.yml up
|
||||
```
|
||||
|
||||
### Config
|
||||
|
||||
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.
|
||||
|
||||
```console
|
||||
docker-compose <server from above> -f deployment/compose/server/config.yml up
|
||||
```
|
||||
|
||||
## Runner
|
||||
|
||||
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.
|
||||
|
||||
### Build
|
||||
|
||||
This simply takes the currently cloned source and builds a new image including
|
||||
all local changes.
|
||||
|
||||
```console
|
||||
docker-compose <server from above> -f deployment/compose/runner/base.yml -f deployment/compose/runner/build.yml up
|
||||
```
|
||||
|
||||
### Image
|
||||
|
||||
This simply downloads the defined image from DockerHub and starts/configures it
|
||||
properly based on the integrated bootstrapping scripts.
|
||||
|
||||
```console
|
||||
docker-compose <server from above> -f deployment/compose/runner/base.yml -f deployment/compose/runner/image.yml up
|
||||
```
|
||||
|
||||
### Config
|
||||
|
||||
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.
|
||||
|
||||
```console
|
||||
docker-compose <runner from above> -f deployment/compose/runner/config.yml up
|
||||
```
|
||||
|
||||
## Database
|
||||
|
||||
After deciding the base of it you should choose one of the supported databases.
|
||||
Here we got currently the following options so far.
|
||||
|
||||
### SQLite
|
||||
|
||||
This simply configures a named volume for the SQLite storage used as a database
|
||||
backend.
|
||||
|
||||
```console
|
||||
docker-compose <server/runner from above> -f deployment/compose/store/sqlite.yml up
|
||||
```
|
||||
|
||||
### BoltDB
|
||||
|
||||
This simply configures a named volume for the BoltDB storage used as a database
|
||||
backend.
|
||||
|
||||
```console
|
||||
docker-compose <server/runner from above> -f deployment/compose/store/boltdb.yml up
|
||||
```
|
||||
|
||||
### MariaDB
|
||||
|
||||
This simply starts an additional container for a MariaDB instance used as a
|
||||
database backend including the required credentials.
|
||||
|
||||
```console
|
||||
docker-compose <server/runner from above> -f deployment/compose/store/mariadb.yml up
|
||||
```
|
||||
|
||||
### MySQL
|
||||
|
||||
This simply starts an additional container for a MySQL instance used as a
|
||||
database backend including the required credentials.
|
||||
|
||||
```console
|
||||
docker-compose <server/runner from above> -f deployment/compose/store/mysql.yml up
|
||||
```
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
This simply starts an additional container for a PostgreSQL instance used as a
|
||||
database backend including the required credentials.
|
||||
|
||||
```console
|
||||
docker-compose <server/runner from above> -f deployment/compose/store/postgres.yml up
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
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`.
|
13
deployment/compose/runner/base.yml
Normal file
13
deployment/compose/runner/base.yml
Normal file
@ -0,0 +1,13 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
runner:
|
||||
image: docker.io/semaphoreui/runner:${SEMAPHORE_VERSION:-latest}
|
||||
restart: always
|
||||
environment:
|
||||
SEMAPHORE_RUNNER_API_URL: ${SEMAPHORE_RUNNER_API_URL:-http://server:3000/api}
|
||||
SEMAPHORE_RUNNER_REGISTRATION_TOKEN: ${SEMAPHORE_RUNNER_REGISTRATION_TOKEN:-H1wDyorbg6gTSwJlVwle2Fne}
|
||||
|
||||
server:
|
||||
environment:
|
||||
SEMAPHORE_RUNNER_REGISTRATION_TOKEN: ${SEMAPHORE_RUNNER_REGISTRATION_TOKEN:-H1wDyorbg6gTSwJlVwle2Fne}
|
7
deployment/compose/runner/build.yml
Normal file
7
deployment/compose/runner/build.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
runner:
|
||||
build:
|
||||
context: ../../../
|
||||
dockerfile: deployment/docker/runner/Dockerfile
|
6
deployment/compose/runner/config.yml
Normal file
6
deployment/compose/runner/config.yml
Normal file
@ -0,0 +1,6 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
runner:
|
||||
volumes:
|
||||
- ${SEMAPHORE_RUNNER_LOCAL_CONFIG:-runner.json}:/etc/semaphore/config.json:Z
|
20
deployment/compose/server/base.yml
Normal file
20
deployment/compose/server/base.yml
Normal file
@ -0,0 +1,20 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
server:
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.io/semaphoreui/semaphore:${SEMAPHORE_VERSION:-latest}
|
||||
restart: always
|
||||
environment:
|
||||
SEMAPHORE_ADMIN_NAME: ${SEMAPHORE_ADMIN_NAME:-Admin}
|
||||
SEMAPHORE_ADMIN: ${SEMAPHORE_ADMIN_USERNAME:-admin}
|
||||
SEMAPHORE_ADMIN_PASSWORD: ${SEMAPHORE_ADMIN_PASSWORD:-p455w0rd}
|
||||
SEMAPHORE_ADMIN_EMAIL: ${SEMAPHORE_ADMIN_EMAIL:-admin@localhost}
|
||||
SEMAPHORE_WEB_ROOT: ${SEMAPHORE_WEB_ROOT:-http://0.0.0.0:3000}
|
||||
SEMAPHORE_ACCESS_KEY_ENCRYPTION: ${SEMAPHORE_ACCESS_KEY_ENCRYPTION:-IlRqgrrO5Gp27MlWakDX1xVrPv4jhoUx+ARY+qGyDxQ=}
|
||||
volumes:
|
||||
- server:/var/lib/semaphore
|
||||
ports:
|
||||
- "3000:3000"
|
7
deployment/compose/server/build.yml
Normal file
7
deployment/compose/server/build.yml
Normal file
@ -0,0 +1,7 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: ../../../
|
||||
dockerfile: deployment/docker/runner/Dockerfile
|
6
deployment/compose/server/config.yml
Normal file
6
deployment/compose/server/config.yml
Normal file
@ -0,0 +1,6 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
server:
|
||||
volumes:
|
||||
- ${SEMAPHORE_RUNNER_LOCAL_CONFIG:-config.json}:/etc/semaphore/config.json:Z
|
12
deployment/compose/store/boltdb.yml
Normal file
12
deployment/compose/store/boltdb.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
boltdb:
|
||||
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- SEMAPHORE_DB_DIALECT=bolt
|
||||
- SEMAPHORE_DB_PATH=/var/lib/database
|
||||
volumes:
|
||||
- boltdb:/var/lib/database
|
31
deployment/compose/store/local.yml
Normal file
31
deployment/compose/store/local.yml
Normal file
@ -0,0 +1,31 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
mariadb:
|
||||
postgres:
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: mariadb:10.8
|
||||
restart: always
|
||||
environment:
|
||||
- MARIADB_ROOT_PASSWORD=root
|
||||
- MARIADB_USER=semaphore
|
||||
- MARIADB_PASSWORD=semaphore
|
||||
- MARIADB_DATABASE=semaphore
|
||||
volumes:
|
||||
- mariadb:/var/lib/mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
|
||||
postgres:
|
||||
image: postgres:14.3
|
||||
restart: always
|
||||
environment:
|
||||
- POSTGRES_USER=semaphore
|
||||
- POSTGRES_PASSWORD=semaphore
|
||||
- POSTGRES_DB=semaphore
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql
|
||||
ports:
|
||||
- 5432:5432
|
27
deployment/compose/store/mariadb.yml
Normal file
27
deployment/compose/store/mariadb.yml
Normal file
@ -0,0 +1,27 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
mariadb:
|
||||
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- SEMAPHORE_DB_DIALECT=mysql
|
||||
- SEMAPHORE_DB_HOST=db
|
||||
- SEMAPHORE_DB_PORT=3306
|
||||
- SEMAPHORE_DB_USER=${MARIADB_USERNAME:-semaphore}
|
||||
- SEMAPHORE_DB_PASS=${MARIADB_PASSWORD:-semaphore}
|
||||
- SEMAPHORE_DB=${MARIADB_DATABASE:-semaphore}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mariadb:10.8
|
||||
restart: always
|
||||
environment:
|
||||
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT:-root}
|
||||
- MARIADB_USER=${MARIADB_USERNAME:-semaphore}
|
||||
- MARIADB_PASSWORD=${MARIADB_PASSWORD:-semaphore}
|
||||
- MARIADB_DATABASE=${MARIADB_DATABASE:-semaphore}
|
||||
volumes:
|
||||
- mariadb:/var/lib/mysql
|
27
deployment/compose/store/mysql.yml
Normal file
27
deployment/compose/store/mysql.yml
Normal file
@ -0,0 +1,27 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
mysql:
|
||||
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- SEMAPHORE_DB_DIALECT=mysql
|
||||
- SEMAPHORE_DB_HOST=db
|
||||
- SEMAPHORE_DB_PORT=3306
|
||||
- SEMAPHORE_DB_USER=${MYSQL_USERNAME:-semaphore}
|
||||
- SEMAPHORE_DB_PASS=${MYSQL_PASSWORD:-semaphore}
|
||||
- SEMAPHORE_DB=${MYSQL_DATABASE:-semaphore}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT:-root}
|
||||
- MYSQL_USER=${MYSQL_USERNAME:-semaphore}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-semaphore}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-semaphore}
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
26
deployment/compose/store/postgres.yml
Normal file
26
deployment/compose/store/postgres.yml
Normal file
@ -0,0 +1,26 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
postgres:
|
||||
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- SEMAPHORE_DB_DIALECT=postgres
|
||||
- SEMAPHORE_DB_HOST=db
|
||||
- SEMAPHORE_DB_PORT=5432
|
||||
- SEMAPHORE_DB_USER=${POSTGRES_USERNAME:-semaphore}
|
||||
- SEMAPHORE_DB_PASS=${POSTGRES_PASSWORD:-semaphore}
|
||||
- SEMAPHORE_DB=${POSTGRES_DATABASE:-semaphore}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgres:14.3
|
||||
restart: always
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USERNAME:-semaphore}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-semaphore}
|
||||
- POSTGRES_DB=${POSTGRES_DATABASE:-semaphore}
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql
|
12
deployment/compose/store/sqlite.yml
Normal file
12
deployment/compose/store/sqlite.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: "3.4"
|
||||
|
||||
volumes:
|
||||
sqlite:
|
||||
|
||||
services:
|
||||
server:
|
||||
environment:
|
||||
- SEMAPHORE_DB_DIALECT=sqlite
|
||||
- SEMAPHORE_DB_PATH=/var/lib/database
|
||||
volumes:
|
||||
- sqlite:/var/lib/database
|
Loading…
Reference in New Issue
Block a user