Skip to content

Instantly share code, notes, and snippets.

@fzliu
Created June 23, 2021 04:12
Show Gist options
  • Save fzliu/02cbaa8702a0a14c4100541d0ed81af5 to your computer and use it in GitHub Desktop.
Save fzliu/02cbaa8702a0a14c4100541d0ed81af5 to your computer and use it in GitHub Desktop.
Gitlab minimal memory installation via docker.
web:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
puma['worker_processes'] = 0
sidekiq['max_concurrency'] = 10
prometheus_monitoring['enable'] = false
gitlab_rails['env'] = {'MALLOC_CONF' => 'dirty_decay_ms:1000, muzzy_decay_ms:1000'}
gitaly['cgroups_count'] = 2
gitaly['cgroups_mountpoint'] = '/sys/fs/cgroup'
gitaly['cgroups_hierarchy_root'] = 'gitaly'
gitaly['cgroups_memory_enabled'] = true
gitaly['cgroups_memory_limit'] = 250000
gitaly['cgroups_cpu_enabled'] = true
gitaly['cgroups_cpu_shares'] = 512
gitaly['concurrency'] = [{'rpc' => "/gitaly.SmartHTTPService/PostReceivePack", 'max_per_repo' => 3}, {'rpc' => "/gitaly.SSHService/SSHUploadPack", 'max_per_repo' => 3}]
gitaly['env'] = {'LD_PRELOAD' => '/opt/gitlab/embedded/lib/libjemalloc.so', 'MALLOC_CONF' => 'dirty_decay_ms:1000,muzzy_decay_ms:1000', 'GITALY_COMMAND_SPAWN_MAX_PARALLEL' => '2'}
ports:
- '80:80'
- '443:443'
volumes:
- '/var/lib/gitlab/config:/etc/gitlab'
- '/var/lib/gitlab/logs:/var/log/gitlab'
- '/var/lib/gitlab/data:/var/opt/gitlab'
@strarsis
Copy link

strarsis commented Sep 4, 2024

@vogdb: Note that with GitLab 17 the options sidekiq['max_concurrency'] and gitaly['ruby_max_rss'] were removed and have to be removed from docker-compose.yml in order to allow GitLab to start up (reconfiguration step during startup).

@vogdb
Copy link

vogdb commented Sep 4, 2024

@strarsis Thanks! I'm still on the latest 15 >_<

@vogdb
Copy link

vogdb commented Jan 1, 2025

@strarsis Happy New Year! I've updated to 17.6.2-ce.0. So far so good. Had only to run this once when updating from 17.5 to 17.6

docker exec -it gitlab update-permissions
docker restart gitlab

Also noted that almost got out of free disk space. Besides to docker prune had to resolve to:

sudo sh -c "truncate -s 0 /var/snap/docker/common/var-lib-docker/containers/*/*-json.log"

@strarsis
Copy link

strarsis commented Jan 1, 2025

@vogdb: Also Happy New Year to you! Yes, disk space is always an issue somehow. I often juggle with the GitLab images, removing the previous version right after downloading the newer one.

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