hello, world. | notes.carranza.engineer

Using docker-compose with GitLab

This is one of my favorite methods for getting a GitLab instance up and running. It’s great for testing and production.

The docker-compose.yml in this repo includes the bits I usually start with:

web:
  image: 'gitlab/gitlab-ee:13.10.3-ee.0'
  restart: always
  hostname: 'svn.secretbank.org'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://svn.secretbank.org'
      # Add any other gitlab.rb configuration here, each on its own line
  ports:
    - '80:80'
    - '443:443'
    - '22:22'
    - '5050:5050'
  volumes:
    - '$GITLAB_HOME/config:/etc/gitlab'
    - '$GITLAB_HOME/logs:/var/log/gitlab'
    - '$GITLAB_HOME/data:/var/opt/gitlab'
    - '/home/briecarranza/letsencrypt:/etc/gitlab/ssl'

runner:
  image: 'gitlab/gitlab-runner:latest'
  restart: always
  hostname: 'runner.secretbank.org'
  volumes:
    - '$RUNNER_HOME:/etc/gitlab-runner'

See docker-compose.yml for more.

Quick Commands

[docker]