-
-
Save ilmsg/58de43bf90257e36e98bac87cb38344c to your computer and use it in GitHub Desktop.
complete Gitlab installation and a runner with docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '4.5' | |
services: | |
# GITLAB | |
gitlab-web: | |
image: 'gitlab/gitlab-ce:latest' | |
restart: always | |
container_name: gitlab-web | |
hostname: '192.168.0.14' | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
external_url 'http://192.168.0.14' | |
gitlab_rails['gitlab_shell_ssh_port'] = 2222 | |
ports: | |
- "80:80" | |
- "443:443" | |
- "2222:22" | |
volumes: | |
- './gitlab/config:/etc/gitlab' | |
- './gitlab/logs:/var/log/gitlab' | |
- './gitlab/data:/var/opt/gitlab' | |
networks: | |
- gitlab-network | |
# RUNNER | |
gitlab-runner1: | |
image: gitlab/gitlab-runner:alpine | |
restart: always | |
container_name: gitlab-runner1 | |
hostname: gitlab-runner1 | |
depends_on: | |
- gitlab-web | |
volumes: | |
- ./config/gitlab-runner:/etc/gitlab-runner | |
- /var/run/docker.sock:/var/run/docker.sock | |
networks: | |
- gitlab-network | |
networks: | |
gitlab-network: | |
name: gitlab-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
################################################################### | |
# Récuperer le token d'enregistrement du runner via ce lien: | |
# http://localhost:8080/root/${project}/settings/ci_cd | |
# Benoit Petit: https://github.com/benoitpetit | |
################################################################### | |
# modifier avec votre token | |
registration_token=XXXXXXXXXXXXXXX | |
url=http://127.0.0.1 | |
docker exec -it gitlab-runner1 \ | |
gitlab-runner register \ | |
--non-interactive \ | |
--registration-token ${registration_token} \ | |
--locked=false \ | |
--description docker-stable \ | |
--url ${url} \ | |
--executor docker \ | |
--docker-image docker:stable \ | |
--docker-volumes "/var/run/docker.sock:/var/run/docker.sock" \ | |
--docker-network-mode gitlab-network | |
# executer le script pour inscrire le runner dans Gitlab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment