GitLab을 실행하기 위해 docker-compose.yml 파일을 작성합니다.
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab ** 컨테이너 이름
hostname: gitlab.local ** 컨테이너 내부 DNS
ports:
- "443:443"
- "8081:8081"
- "8022:22"
volumes: ** 볼륨 설정
- ./gitlab/config:/etc/gitlab
- ./gitlab/logs:/var/log/gitlab
- ./gitlab/data:/var/opt/gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['gitlab_shell_ssh_port'] = 8022
external_url 'http://localhost:8081' ** 외부 노출 url
GitLab 컨테이너를 실행합니다.
docker compose up -d
✅ 초기 실행 시 GitLab의 설정 및 초기화 때문에 다소 시간이 소요될 수 있습니다.
웹 브라우저에서 아래 URL로 접속하여 GitLab 실행 여부를 확인합니다.
http://localhost:8081 로 접속
GitLab 초기 화면이 정상적으로 출력되면 설치가 완료된 것입니다.