Создание разделов
sudo mkdir -p /opt/gitlab
sudo mkdir -p /opt/gitlab/config
sudo mkdir -p /opt/gitlab/logs
sudo mkdir -p /opt/gitlab/data
sudo mkdir -p /opt/gitlab-runner
sudo mkdir -p /opt/gitlab-runner/config
sudo mkdir -p /opt/gitlab-runner/data
Создание docker-compose.yml
version: '3.7'
services:
gitlab:
container_name: gitlab
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: '192.168.42.83'
environment:
GITLAB_OMNIBUS_CONFIG:
external_url 'https://192.168.42.83/'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '192.168.42.83:8026:80'
- '192.168.42.83:44326:443'
- '192.168.42.83:2226:22'
volumes:
- '/opt/gitlab/config:/etc/gitlab'
- '/opt/gitlab/logs:/var/log/gitlab'
- '/opt/gitlab/data:/var/opt/gitlab'
gitlab-runner:
container_name: gitlab-runner
image: gitlab/gitlab-runner:latest
restart: always
volumes:
- '/opt/gitlab-runner/data:/home/gitlab_ci_multi_runner/data'
- '/opt/gitlab-runner/config:/etc/gitlab-runner'
- '/var/run/docker.sock:/var/run/docker.sock:rw'
environment:
- CI_SERVER_URL=https://192.168.42.83/ci
Получение пароля для root
sudo cat /opt/gitlab/config/initial_root_password
Настройка домена
- В шлюзе nginx указываем:
location /.well-knownXXXX/ {
index index.php index.html;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_pass_header Set-Cookie;
proxy_set_header X-Forwarded-Host $proxy_host;
}
- В /opt/gitlab/config/gitlab.rb правим строку к виду
external_url 'https://gitlab.ibxc.ru'
- Переконфигурирование: gitlab-ctl reconfigure
- Возвращаем в nginx
location /.well-knownXXXX/ {
на location /.well-known/ {
для обновления SSL