mirror of https://github.com/vimagick/dockerfiles
update gitlab
This commit is contained in:
parent
44e2f60603
commit
eaa75b551f
|
@ -7,18 +7,17 @@ deployment tool.
|
||||||
|
|
||||||
## docker-compose.yml
|
## docker-compose.yml
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
gitlab:
|
gitlab:
|
||||||
image: gitlab/gitlab-ce
|
image: gitlab/gitlab-ce
|
||||||
hostname: git.example.com
|
hostname: git.example.com
|
||||||
environment:
|
environment:
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
GITLAB_OMNIBUS_CONFIG: |
|
||||||
external_url 'https://git.example.com'
|
external_url 'https://git.example.com'
|
||||||
nginx['redirect_http_to_https'] = true
|
gitlab_rails['gitlab_shell_ssh_port'] = 2222
|
||||||
ports:
|
ports:
|
||||||
- "22:22"
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
- "443:443"
|
||||||
|
- "2222:22"
|
||||||
volumes:
|
volumes:
|
||||||
- ./gitlab/config:/etc/gitlab
|
- ./gitlab/config:/etc/gitlab
|
||||||
- ./gitlab/logs:/var/log/gitlab
|
- ./gitlab/logs:/var/log/gitlab
|
||||||
|
@ -26,25 +25,40 @@ gitlab:
|
||||||
restart: always
|
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
|
$ vi /etc/ssh/sshd_config
|
||||||
- Port 22
|
- Port 22
|
||||||
+ Port 2222
|
+ Port 2222
|
||||||
|
|
||||||
$ systemctl restart ssh
|
$ systemctl restart ssh
|
||||||
|
$ ssh -p 2222 localhost
|
||||||
$ docker-compose up -d
|
|
||||||
|
|
||||||
$ firefox https://git.example.com
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 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 <https://git.example.com> in your web browser:
|
||||||
|
|
||||||
|
- username: `root`
|
||||||
|
- password: `5iveL!fe`
|
||||||
|
|
||||||
## backup volumes
|
## backup volumes
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ docker run --rm \
|
$ docker run --rm \
|
||||||
--volumes-from gitlab_gitlab_1 \
|
--volumes-from gitlab_gitlab_1 \
|
||||||
-v $PWD:/tmp \
|
-v $PWD:/tmp \
|
||||||
|
@ -58,5 +72,6 @@ $ tar tzf gitlab.tgz
|
||||||
|
|
||||||
- http://docs.gitlab.com/omnibus/docker/
|
- 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/nginx.md
|
||||||
|
- https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/configuration.md
|
||||||
|
|
||||||
[1]: https://gitlab.com/
|
[1]: https://gitlab.com/
|
||||||
|
|
|
@ -4,11 +4,10 @@ gitlab:
|
||||||
environment:
|
environment:
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
GITLAB_OMNIBUS_CONFIG: |
|
||||||
external_url 'https://git.example.com'
|
external_url 'https://git.example.com'
|
||||||
nginx['redirect_http_to_https'] = true
|
gitlab_rails['gitlab_shell_ssh_port'] = 2222
|
||||||
ports:
|
ports:
|
||||||
- "22:22"
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
- "443:443"
|
||||||
|
- "2222:22"
|
||||||
volumes:
|
volumes:
|
||||||
- ./gitlab/config:/etc/gitlab
|
- ./gitlab/config:/etc/gitlab
|
||||||
- ./gitlab/logs:/var/log/gitlab
|
- ./gitlab/logs:/var/log/gitlab
|
||||||
|
|
Loading…
Reference in New Issue