From 583e786bfa9fb3d6d72f09ad063b0cbf32961bff Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 26 May 2021 16:45:45 +0800 Subject: [PATCH] gitlab Former-commit-id: a0c62d1d928a3abaf7cf81dbafa69915716283aa Former-commit-id: 562f77abc71bdbc48d07de29fb3be9e78b89d92b --- labs/gitlab/.env | 6 +++++- labs/gitlab/docker-compose.yml | 18 +++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/labs/gitlab/.env b/labs/gitlab/.env index 66b79e86..8d75d468 100644 --- a/labs/gitlab/.env +++ b/labs/gitlab/.env @@ -1,2 +1,6 @@ TZ=Asia/Shanghai -IP=192.168.100.144 \ No newline at end of file +IP=192.168.100.144 +PORT=9080 +#windows:docker.sock=//var/run/docker.sock +#linux:docker.sock=/var/run/docker.sock +docker.sock=//var/run/docker.sock diff --git a/labs/gitlab/docker-compose.yml b/labs/gitlab/docker-compose.yml index 51a55642..f8683e65 100644 --- a/labs/gitlab/docker-compose.yml +++ b/labs/gitlab/docker-compose.yml @@ -6,17 +6,18 @@ services: image: gitlab/gitlab-ce:13.12.0-ce.0 restart: always privileged: true - hostname: ${IP} + hostname: gitlab environment: TZ: ${TZ} GITLAB_ROOT_PASSWORD: aA123456! GITLAB_OMNIBUS_CONFIG: | - external_url 'http://${IP}' + external_url 'http://${IP}:${PORT}' + nginx['listen_port'] = ${PORT} gitlab_rails['time_zone'] = 'Asia/Shanghai' ports: - - 9080:80 - #- 9443:443 - #- 9022:22 + - ${PORT}:${PORT} + # - 9443:443 + # - 9022:22 volumes: - ./data/gitlab/etc:/etc/gitlab - ./data/gitlab/log:/var/log/gitlab @@ -24,6 +25,8 @@ services: #https://docs.gitlab.com/runner/register/index.html#docker #http://localhost:9080/admin/runners #gitlab-runner register + #docker:20.10.6 + #https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-the-docker-executor-with-the-docker-image-docker-in-docker gitlab-runner: image: gitlab/gitlab-runner:alpine-v13.12.0 restart: always @@ -31,7 +34,8 @@ services: environment: TZ: ${TZ} volumes: - - /var/run/docker.sock:/var/run/docker.sock + #- /var/run/docker.sock:/var/run/docker.sock + - ${docker.sock}:/var/run/docker.sock - ./data/gitlab-runner:/etc/gitlab-runner depends_on: - - gitlab + - gitlab \ No newline at end of file