Docker-compose部署gitlab

1.新建文件夹 配置docker-compose.yml

[root@doc doc-gitlab]# vi docker-compose.yml 
version: '3'
services:
    web:
      image: 'twang2218/gitlab-ce-zh'
      restart: always
      hostname: '172.26.121.43'
      environment:
        TZ: 'Asia/Shanghai'
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://172.26.121.43'
          gitlab_rails['gitlab_shell_ssh_port'] = 2222
          unicorn['port'] = 8888
          nginx['listen_port'] = 80
      ports:
        - '8088:80'
        - '2443:443'
        - '2222:22'
      volumes:
        - ./config:/etc/gitlab
        - ./data:/var/opt/gitlab
        - ./logs:/var/log/gitlab

2.启动容器

[root@doc doc-gitlab]# docker-compose up -d
Starting doc-gitlab_web_1 ... done

3.查看容器

[root@doc doc-gitlab]# docker ps
CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS                   PORTS                                                               NAMES
a41be6d838bc        twang2218/gitlab-ce-zh   "/assets/wrapper"   10 minutes ago      Up 3 minutes (healthy)   0.0.0.0:2222->22/tcp, 0.0.0.0:8088->80/tcp, 0.0.0.0:2443->443/tcp   doc-gitlab_web_1

4.查看页面

Docker-compose部署gitlab_第1张图片
image.png

你可能感兴趣的:(Docker-compose部署gitlab)