diff --git a/.env.example b/.env.example index a43cca4c54..d0d4b37d55 100755 --- a/.env.example +++ b/.env.example @@ -9,6 +9,7 @@ MIX_APP_URL="${APP_URL}" # The following two variables are only used for docker compose production installations. SSL_CERTIFICATE_FILE=/etc/ssl/certs/ssl-cert-snakeoil.pem SSL_CERTIFICATE_KEY_FILE=/etc/ssl/private/ssl-cert-snakeoil.key +NUM_WORKERS=1 # database.php DB_DATABASE=cdash diff --git a/docker/docker-compose.production.yml b/docker/docker-compose.production.yml index e9be2844ac..98197a51b7 100644 --- a/docker/docker-compose.production.yml +++ b/docker/docker-compose.production.yml @@ -8,15 +8,18 @@ services: - "${SSL_CERTIFICATE_FILE}:/var/www/my-cert.pem" - "${SSL_CERTIFICATE_KEY_FILE}:/var/www/my-cert.key" worker: + env_file: + - ../.env image: kitware/cdash-worker - container_name: cdash_worker build: context: .. target: cdash-worker environment: DB_HOST: database deploy: - replicas: 1 + replicas: ${NUM_WORKERS:-1} + restart_policy: + condition: any depends_on: cdash: condition: service_healthy diff --git a/docs/docker.md b/docs/docker.md index 798003e91e..6abbbbd7c4 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -69,6 +69,7 @@ To set up a CDash production instance using docker compose, follow these steps: - `APP_URL=https://` - `SSL_CERTIFICATE_FILE=` - `SSL_CERTIFICATE_KEY_FILE=` + - `NUM_WORKERS=` * For postgres only, edit `docker/docker-compose.postgres.yml` and uncomment the `worker` section. * Run this command to start your CDash containers: ```bash