Skip to content

Instantly share code, notes, and snippets.

@asabla
Created August 6, 2016 17:10
Show Gist options
  • Save asabla/4d092715590632813e6ba25dd93118bc to your computer and use it in GitHub Desktop.
Save asabla/4d092715590632813e6ba25dd93118bc to your computer and use it in GitHub Desktop.
Docker Gitlab setup
db:
image: sameersbn/postgresql
container_name: gitlab-postgresql
restart: always
volumes:
- "/local/db/location/postgresql:/var/lib/postgresql"
environment:
- DB_NAME: gitlabhq_production
- DB_USER: gitlab
- DB_PASS: DBPASSWORD
redis:
image: sameersbn/redis
container_name: gitlab-redis
restart: always
volumes:
- "/local/cache/location/redis:/var/lib/redis"
gitlab:
image: sameersbn/gitlab
container_name: gitlab
restart: always
ports:
- "3003:22"
- "10080:80"
links:
- gitlab-postgresql:postgresql
- gitlab-redis:redisio
volumes:
- "local/git/location/gitlab:/home/git/data"
environment:
- GITLAB_PORT: 443
- GITLAB_SECRETS_DB_KEY: SECREYKEYBASESTRING
- GITLAB_HOST: git.example.com
- GITLAB_HTTPS: true
- SSL_CERTIFICATE_PATH: fullchain.pem
- SSL_KEY_PATH: privkey.pem
docker run --name gitlab-postgresql -d \
--env 'DB_NAME=gitlabhq_production' \
--env 'DB_USER=gitlab' \
--env 'DB_PASS=DBPASSWORD' \
--volume /local/db/location/postgresql:/var/lib/postgresql \
sameersbn/postgresql
docker run --name gitlab-redis -d \
--volume /local/cache/location/redis:/var/lib/redis \
sameersbn/redis
docker run --name gitlab -d \
--link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
--publish 3003:22 --publish 10080:80 \
--env 'GITLAB_PORT=443' --env 'GITLAB_SSH_PORT=3003' \
--env 'GITLAB_SECRETS_DB_KEY_BASE=SECRETKEYBASESTRING' \
--env 'GITLAB_HOST=git.example.com' \
--env 'GITLAB_HTTPS=true' \
--env 'SSL_CERTIFICATE_PATH=fullchain.pem' \
--env 'SSL_KEY_PATH=privkey.pem' \
--volume /local/git/location/gitlab:/home/git/data \
sameersbn/gitlab
@diox8tony
Copy link

diox8tony commented Feb 13, 2018

oooh, don't forget these other undocumented variables.
--env 'GITLAB_SECRETS_SECRET_KEY_BASE=2ndrandomkey'
--env 'GITLAB_SECRETS_OTP_KEY_BASE=3rdrandomkey'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment