Created
August 6, 2016 17:10
-
-
Save asabla/4d092715590632813e6ba25dd93118bc to your computer and use it in GitHub Desktop.
Docker Gitlab setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oooh, don't forget these other undocumented variables.
--env 'GITLAB_SECRETS_SECRET_KEY_BASE=2ndrandomkey'
--env 'GITLAB_SECRETS_OTP_KEY_BASE=3rdrandomkey'