docker-compose 快速部署 gitlab 社区版

发布于 2022-08-24 13:06:33阅读 1022

直接上配置文件

docker-compose.yml

version: '3.6'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:15.3.1-ce.0'
    hostname: git.cuiwei.net
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://git.cuiwei.net'
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
    shm_size: '256m'

域名 git.cuiwei.net,需要配置正确的解析和ssl证书;如果是本地测试,直接修改hosts也行

启动服务

docker-compose up -d

稍等几分钟,服务起来之后,访问https://git.cuiwei.net即可看到

WX202208242055222x.jpg

root是默认的用户,密码在./config/initial_root_password

最后吐槽一下这个镜像文件gitlab/gitlab-ce:15.3.1-ce.0,这是一个All-In-One的东西,包含nginx,redis,postgresql等。镜像压缩大小为1.09 GB,展开后2.64 GB,太大了

参考

https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-compose

广而告之,我的新作品《语音助手》上架Google Play了,欢迎下载体验