docker-compose gitlab安装

2020/12/13 gitlabdocker-compose

构建环境:docker、docker-compose

# 配置文件

vim /docker/docker-compose.yml

version: "3.9"
services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.9.210:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '22:22'
    volumes:
      - /docker/gitlab/config:/etc/gitlab
      - /docker/gitlab/logs:/var/log/gitlab
      - /docker/gitlab/data:/var/opt/gitlab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
chmod -R 777 config data logs
1

# 运行

docker up  -d
1

访问: http://IP:8929/
root用户的密码在/docker/gitlab/config/initial_root_password

# 设置中文

Gitlab设置为中文 root用户登录,右上角头像,Settings -> Preferences -> Localization -> Language,选择“简体中文”即可”

# 审批新用户

管理中心 -> 用户

# 项目webhook报500

[root@localhost gitlab2]# docker exec -it gitlab2 /bin/bash
root@5fe9201fa188:/# su - gitlab-psql 
$ psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
psql (12.7)
Type "help" for help.

gitlabhq_production=# select id from web_hooks where project_id=63;
 id 
----
 13
(1 row)

curl --header "Private-Token: vCAxBjTWm6_HRNtz65vG" -X DELETE http://192.168.9.210:8931/api/v4/projects/63/hooks/13
1
2
3
4
5
6
7
8
9
10
11
12
13

63是项目ID
vCAxBjTWm6_HRNtz65vG是root用户的token

Last Updated: 2024/2/22 15:13:31