# # PLEASE READ https://ovh.github.io/cds/hosting/ready-to-run/docker-compose/ # version: '3' services: cds-db: image: postgres:9.6.2 environment: POSTGRES_PASSWORD: cds POSTGRES_USER: cds cds-cache: image: redis:alpine command: redis-server --requirepass cds restart: always elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:6.7.2 environment: - discovery.type=single-node - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 volumes: - cds-elasticsearch-volume:/usr/share/elasticsearch/data restart: always cds-migrate: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: /app/cds-engine-linux-amd64 database upgrade --db-host cds-db --db-user cds --db-password cds --db-name cds --db-sslmode disable --migrate-dir /app/sql links: - cds-db cds-prepare: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: > sh -c " /app/cds-engine-linux-amd64 config new > /app/conf/conf.toml; mkdir -p /app/artifacts /app/repositories /app/hatchery-local; chown -R cds:cds /app/conf /app/artifacts /app/repositories /app/hatchery-local; /app/cds-engine-linux-amd64 config edit /app/conf/conf.toml --output /app/conf/conf.toml \ api.artifact.local.baseDirectory=/app/artifacts \ api.cache.redis.host=cds-cache:6379 \ api.cache.redis.password=cds \ api.database.connectTimeout=10 \ api.database.host=cds-db \ api.database.name=cds \ api.database.user=cds \ api.database.password=cds \ api.database.sslmode=disable \ api.directories.download=/app \ api.url.api=http://${HOSTNAME}:8081 \ api.url.ui=http://${HOSTNAME}:8080 \ api.log.level=info \ api.smtp.disable=false \ api.smtp.port=2023 \ api.smtp.host=smtpmocksrv \ hatchery.local.commonConfiguration.url=http://cds-hatchery-local:8086 \ hatchery.local.commonConfiguration.api.http.url=http://cds-api:8081 \ hatchery.local.basedir=/app/hatchery-local \ hatchery.swarm.commonConfiguration.url=http://cds-hatchery-swarm:8086 \ hatchery.swarm.commonConfiguration.api.http.url=http://${HOSTNAME}:8081 \ hatchery.swarm.ratioService=50 \ hatchery.swarm.dockerEngines.sample-docker-engine.host=tcp://dockerhost:2375 \ hatchery.swarm.dockerEngines.sample-docker-engine.maxContainers=4 \ hooks.url=http://cds-hooks:8083 \ hooks.api.http.url=http://cds-api:8081 \ hooks.cache.redis.host=cds-cache:6379 \ hooks.cache.redis.password=cds \ vcs.URL=http://cds-vcs:8084 \ vcs.api.http.url=http://cds-api:8081 \ vcs.cache.redis.host=cds-cache:6379 \ vcs.cache.redis.password=cds \ repositories.URL=http://cds-repositories:8085 \ repositories.basedir=/app/repositories \ repositories.api.http.url=http://cds-api:8081 \ repositories.cache.redis.host=cds-cache:6379 \ repositories.cache.redis.password=cds \ elasticsearch.URL=http://cds-elasticsearch:8088 \ elasticsearch.api.http.url=http://cds-api:8081 \ elasticsearch.name=cds-elasticsearch \ elasticsearch.elasticsearch.indexEvents=cds-index-events \ elasticsearch.elasticsearch.indexMetrics=cds-index-metrics \ elasticsearch.elasticsearch.url=http://elasticsearch:9200 \ ui.url=http://${HOSTNAME}:8080 \ ui.api.http.url=http://cds-api:8081 \ ui.hooksURL=http://cds-hooks:8083; echo ''; echo '/!\ Please run the export command BELOW, this will be useful to create admin user'; echo ''; TOKEN=`/app/cds-engine-linux-amd64 config init-token --config /app/conf/conf.toml`; echo 'export INIT_TOKEN='$$TOKEN; echo ''; echo '/!\ Please run the export command ABOVE, this will be useful to create admin user'; echo '';" user: root volumes: - cds-conf-volume:/app/conf - cds-artifacts-volume:/app/artifacts - cds-repositories-volume:/app/repositories - cds-hatchery-local-volume:/app/hatchery-local cds-api: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start api --config /app/conf/conf.toml" volumes: - cds-artifacts-volume:/app/artifacts - cds-conf-volume:/app/conf ports: - "8081:8081" links: - cds-db - cds-cache healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8081/mon/version"] interval: 30s timeout: 10s retries: 6 cds-ui: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start ui --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf ports: - "8080:8080" links: - cds-api - cds-hooks healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/mon/version"] interval: 30s timeout: 10s retries: 6 cds-hatchery-swarm: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start hatchery:swarm --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8086/mon/version"] interval: 30s timeout: 10s retries: 6 cds-hatchery-local: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start hatchery:local --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf - cds-hatchery-local-volume:/app/hatchery-local links: - cds-api ports: - "127.0.0.1:8086:8086" healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8086/mon/version"] interval: 30s timeout: 10s retries: 6 cds-hooks: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start hooks --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf links: - cds-api - cds-cache ports: - "127.0.0.1:8083:8083" healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8083/mon/version"] interval: 30s timeout: 10s retries: 6 cds-vcs: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start vcs --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf links: - cds-api - cds-cache healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8084/mon/version"] interval: 30s timeout: 10s retries: 6 cds-repositories: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start repositories --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf - cds-repositories-volume:/app/repositories links: - cds-api healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8085/mon/version"] interval: 30s timeout: 10s retries: 6 cds-elasticsearch: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: sh -c "/app/cds-engine-linux-amd64 start elasticsearch --config /app/conf/conf.toml" volumes: - cds-conf-volume:/app/conf links: - cds-api - elasticsearch restart: always healthcheck: test: ["CMD", "curl", "-f", "http://127.0.0.1:8088/mon/version"] interval: 30s timeout: 10s retries: 6 cds-edit-config: image: ${CDS_DOCKER_IMAGE:-ovhcom/cds-engine:latest} command: > sh -c " /app/cds-engine-linux-amd64 config edit /app/conf/conf.toml --output /app/conf/conf.toml \ ${CDS_EDIT_CONFIG}"; volumes: - cds-conf-volume:/app/conf dockerhost: image: bobrik/socat command: TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - "127.0.0.1:2375:2375" smtpmocksrv: build: context: ./tools/smtpmock ports: - "2023:2023" - "2024:2024" kibana: image: docker.elastic.co/kibana/kibana-oss:6.7.2 ports: - "127.0.0.1:5601:5601" links: - elasticsearch volumes: cds-artifacts-volume: cds-repositories-volume: cds-hatchery-local-volume: cds-conf-volume: cds-elasticsearch-volume: