services: gitlab: image: gitlab/gitlab-ce:latest container_name: gitlab restart: always hostname: "gitlab.example.com" environment: GITLAB_OMNIBUS_CONFIG: | # Add any other gitlab.rb configuration here, each on its own line external_url 'http://gitlab.example.com:8929' gitlab_rails['gitlab_shell_ssh_port'] = 2424 ports: - "${HTTP_PORT}:80" - "${HTTPS_PORT}:443" - "${SSH_PORT}:22" volumes: - "/path/to/gitlab/config:/etc/gitlab" - "/path/to/gitlab/logs:/var/log/gitlab" - "/path/to/gitlab/data:/var/opt/gitlab" shm_size: "2gb"