## gitlab+docker-compose安装部署git服务环境
docker-compose.yml
``` yml
version: '3'
services:
gitlab:
image: 'gitlab/gitlab-ce:latest'
container_name: gitlab
restart: always
environment:
TZ: 'Asia/Shanghai'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://127.0.0.1:3000'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
gitlab_rails['smtp_enable'] = false
gitlab_rails['gitlab_email_enabled'] = false
gitlab_rails['incoming_email_enabled'] = false
gitlab_rails['terraform_state_enabled'] = false
gitlab_rails['usage_ping_enabled'] = false
gitlab_rails['sentry_enabled'] = false
grafana['reporting_enabled'] = false
gitlab_rails['gitlab_default_projects_features_container_registry'] = false
gitlab_rails['registry_enabled'] = false
registry['enable'] = false
registry_nginx['enable'] = false
gitlab_rails['packages_enabled'] = false
gitlab_rails['dependency_proxy_enabled'] = false
gitlab_kas['enable'] = false
gitlab_rails['gitlab_kas_enabled'] = false
mattermost['enable'] = false
mattermost_nginx['enable'] = false
gitlab_rails['kerberos_enabled'] = false
sentinel['enable'] = false
gitlab_pages['enable'] = false
pages_nginx['enable'] = false
puma['worker_processes'] = 0
puma['min_threads'] = 1
puma['max_threads'] = 2
sidekiq['max_concurrency'] = 5
gitlab_ci['gitlab_ci_all_broken_builds'] = false
gitlab_ci['gitlab_ci_add_pusher'] = false
prometheus_monitoring['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
pgbouncer_exporter['enable'] = false
gitlab_exporter['enable'] = false
grafana['enable'] = false
sidekiq['metrics_enabled'] = false
ports:
- '3000:3000'
- '8443:443'
- '2222:22'
volumes:
- ./config:/etc/gitlab
- ./data:/var/opt/gitlab
- ./logs:/var/log/gitlab
logging:
driver: "json-file"
options:
max-size: "2g"
max-file: "2"
```
``` Bash
# 执行命令查看root账号初始密码进入后修改密码
docker-compose exec gitlab bash -c 'cat /etc/gitlab/initial_root_password'
```
浏览器输入 http://localhost:3000/ 使用账号 root 和 /etc/gitlab/initial_root_password 文件中密码进行登录,登录成功后修改密码
完成