Loading

Docker-Compose 安装 Gitlab

docker-compose.yml 文件

version: '3'
services:
    web:
      image: 'twang2218/gitlab-ce-zh:10.5'
      restart: always
      hostname:'域名'
      environment:
        TZ: 'Asia/Shanghai'
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://域名或ip:port'
          gitlab_rails['gitlab_shell_ssh_port'] = 2222
          unicorn['port'] = 8888
          nginx['listen_port'] = 9080
      ports:
        - '9080:80'
        - '8443:443'
        - '2222:22'
      volumes:
        - /usr/local/docker/gitlab/config:/etc/gitlab
        - /usr/local/docker/gitlab/data:/var/opt/gitlab
        - /usr/local/docker/gitlab/logs:/var/log/gitlab

启动

docker-compose up -d

访问 http://域名或ip:port即可

如果已经安装了nginx可能会出现冲突

posted @ 2021-03-28 14:52  zzxaaas  阅读(85)  评论(0编辑  收藏  举报