From eaa75b551fffe569db1ba136a2b507dcb5f70487 Mon Sep 17 00:00:00 2001 From: kev Date: Fri, 2 Sep 2016 10:27:40 +0800 Subject: [PATCH] update gitlab --- gitlab/README.md | 41 ++++++++++++++++++++++++++------------- gitlab/docker-compose.yml | 5 ++--- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/gitlab/README.md b/gitlab/README.md index 7e0e898..914c96a 100644 --- a/gitlab/README.md +++ b/gitlab/README.md @@ -7,18 +7,17 @@ deployment tool. ## docker-compose.yml -``` +```yaml gitlab: image: gitlab/gitlab-ce hostname: git.example.com environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://git.example.com' - nginx['redirect_http_to_https'] = true + gitlab_rails['gitlab_shell_ssh_port'] = 2222 ports: - - "22:22" - - "80:80" - "443:443" + - "2222:22" volumes: - ./gitlab/config:/etc/gitlab - ./gitlab/logs:/var/log/gitlab @@ -26,25 +25,40 @@ gitlab: restart: always ``` -> You can put TLS crt+key into `./gitlab/config/ssl/`. +You can put TLS crt+key into `./gitlab/config/ssl/`: -## up and running +- `git.example.com.crt` +- `git.example.com.key` -``` +If you bind port 22, you need to change host `sshd` config: + +```bash $ vi /etc/ssh/sshd_config - Port 22 + Port 2222 - $ systemctl restart ssh - -$ docker-compose up -d - -$ firefox https://git.example.com +$ ssh -p 2222 localhost ``` +## up and running + +```bash +$ mkdir -p ~/fig/gitlab/gitlab/config/ssh +$ cd ~/fig/gitlab/gitlab/config/ssh +$ openssl req -newkey rsa:4096 -nodes -sha256 -x509 -days 365 \ + -keyout git.example.com.key \ + -out git.example.com.crt +$ docker-compose up -d +``` + +Open in your web browser: + +- username: `root` +- password: `5iveL!fe` + ## backup volumes -``` +```bash $ docker run --rm \ --volumes-from gitlab_gitlab_1 \ -v $PWD:/tmp \ @@ -58,5 +72,6 @@ $ tar tzf gitlab.tgz - http://docs.gitlab.com/omnibus/docker/ - https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md +- https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/configuration.md [1]: https://gitlab.com/ diff --git a/gitlab/docker-compose.yml b/gitlab/docker-compose.yml index 28987cb..69f4b13 100644 --- a/gitlab/docker-compose.yml +++ b/gitlab/docker-compose.yml @@ -4,11 +4,10 @@ gitlab: environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://git.example.com' - nginx['redirect_http_to_https'] = true + gitlab_rails['gitlab_shell_ssh_port'] = 2222 ports: - - "22:22" - - "80:80" - "443:443" + - "2222:22" volumes: - ./gitlab/config:/etc/gitlab - ./gitlab/logs:/var/log/gitlab