Docker-gitlab部署

2017-04-27  本文已影响0人  Eraz

sameersbn/gitlab/#installation

图片.png

拉取docker镜像

docker pull sameersbn/postgresql:latest
docker pull sameersbn/redis:latest
docker pull sameersbn/gitlab:latest

docker 安装 postgresql

docker run --name gitlab-postgresql -d \
    --publish 5432:5432 \
    --env 'PG_TRUST_LOCALNET=true' \
    --env 'PG_PASSWORD=yourpassword' \
    --env 'DB_NAME=gitlabhq_production' \
    --env 'DB_USER=gitlab' --env 'DB_PASS=password' \
    --env 'DB_EXTENSION=pg_trgm' \
    --volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
    sameersbn/postgresql:latest

docker 安装 redis

docker run --name gitlab-redis -d \
    --volume /srv/docker/gitlab/redis:/var/lib/redis \
    sameersbn/redis:latest

docker 安装 gitlab

docker run --name gitlab -d \
    --link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
    --publish 10022:22 --publish 10080:80 \
    --env 'GITLAB_PORT=80' --env 'GITLAB_SSH_PORT=22' \
    --env 'GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string' \
    --env 'GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string' \
    --env 'GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string' \
    --volume /srv/docker/gitlab/gitlab:/home/git/data \
    sameersbn/gitlab:latest

docker-compse

version: '2'
services:
  gitlab-postgresql:
    image: sameersbn/postgresql:latest
    environment:
      PG_TRUST_LOCALNET: 'true'
      PG_PASSWORD: Passw0rd
      DB_NAME: gitlabhq_production
      DB_USER: gitlab
      DB_PASS: Passw0rd
    stdin_open: true
    volumes:
    - /srv/docker/gitlab/postgresql:/var/lib/postgresql
    tty: true
    ports:
    - 5432:5432/tcp
  gitlab-redis:
    image: sameersbn/redis:latest
    stdin_open: true
    volumes:
    - /srv/docker/gitlab/redis:/var/lib/redis
    tty: true
  gitlab:
    image: sameersbn/gitlab:latest
    environment:
      GITLAB_PORT: '80'
      GITLAB_SSH_PORT: '22'
      GITLAB_SECRETS_DB_KEY_BASE: long-and-random-alpha-numeric-string
      GITLAB_SECRETS_SECRET_KEY_BASE: long-and-random-alpha-numeric-string
      GITLAB_SECRETS_OTP_KEY_BASE: long-and-random-alpha-numeric-string
    volumes:
    - /srv/docker/gitlab/gitlab:/home/git/data
    links:
    - gitlab-redis:redisio
    - gitlab-postgresql:postgresql
    ports:
    - 10020:22/tcp
    - 10080:80/tcp
上一篇 下一篇

猜你喜欢

热点阅读