From 3775119f79c456482c7b3e80052d595979125427 Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Thu, 21 Dec 2023 18:02:50 +0800 Subject: [PATCH] fix gitlab --- apps/gitlab/.env | 13 ++---- apps/gitlab/docker-compose-enterprise.yml | 49 +++++++++++++++++++++++ apps/gitlab/docker-compose-jihu.yml | 49 +++++++++++++++++++++++ apps/gitlab/docker-compose.yml | 1 + apps/gitlab/variables.json | 4 ++ apps/gogs/.env | 7 +++- apps/gogs/docker-compose.yml | 7 +--- 7 files changed, 114 insertions(+), 16 deletions(-) create mode 100644 apps/gitlab/docker-compose-enterprise.yml create mode 100644 apps/gitlab/docker-compose-jihu.yml diff --git a/apps/gitlab/.env b/apps/gitlab/.env index 9a5d8f859..9aee8bca4 100644 --- a/apps/gitlab/.env +++ b/apps/gitlab/.env @@ -1,9 +1,7 @@ -# Gitlab edition: ce, ee -W9_CE_IMAGEURL=gitlab/gitlab-ce -W9_EE_IMAGEURL=gitlab/gitlab-ee -W9_JH_IMAGEURL=registry.gitlab.cn/omnibus/gitlab-jh -W9_REPO=$W9_CE_IMAGEURL +# Gitlab edition: ce, ee, jihu +W9_REPO=gitlab/gitlab-ce W9_VERSION=latest +W9_POWER_PASSWORD=uQ8E1wVTzG8SOk3! #### -- Not allowed to edit below environments when recreate app based on existing data -- #### @@ -12,10 +10,7 @@ W9_SSH_PORT_SET=23 W9_HTTP_PORT=80 W9_ID=gitlab W9_LOGIN_USER=root -# how to get Gitlab root password? -# sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password -W9_LOGIN_GET_PASSWORD="sudo docker exec -it $W9_ID grep 'Password:' /etc/gitlab/initial_root_password" -W9_URL_REPLACE=true +W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD # The URL does not need a protocol, such as http://, just the domain name W9_URL=appname.example.com W9_NETWORK=websoft9 diff --git a/apps/gitlab/docker-compose-enterprise.yml b/apps/gitlab/docker-compose-enterprise.yml new file mode 100644 index 000000000..d62dde201 --- /dev/null +++ b/apps/gitlab/docker-compose-enterprise.yml @@ -0,0 +1,49 @@ +# image: https://hub.docker.com/r/gitlab/gitlab-ce +# docs: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/master/docker +# postgresql is in this container + +version: '3.8' + +services: + + gitlab: + image: gitlab/gitlab-ee:$W9_VERSION + container_name: "$W9_ID" + hostname: "$W9_URL" + env_file: .env + environment: + GITLAB_OMNIBUS_CONFIG: | + # external_url rule: the protocol must be http://, can not use https:// + # external_url 'http://$W9_URL' + gitlab_rails['gitlab_shell_ssh_port'] = 22 + # Add any other gitlab.rb configuration here, each on its own line + # other + shm_size: '256m' + restart: unless-stopped + ports: + - '${W9_HTTP_PORT_SET}:80' + - '${W9_SSH_PORT_SET}:22' + volumes: + - gitlab_config:/etc/gitlab + - gitlab_logs:/var/log/gitlab + - gitlab_data:/var/opt/gitlab + + runner: + image: gitlab/gitlab-runner:latest + container_name: $W9_ID-runner + restart: unless-stopped + volumes: + - gitlab_runner:/etc/gitlab-runner + - /var/run/docker.sock:/var/run/docker.sock + env_file: .env + +networks: + default: + name: ${W9_NETWORK} + external: true + +volumes: + gitlab_config: + gitlab_logs: + gitlab_data: + gitlab_runner: \ No newline at end of file diff --git a/apps/gitlab/docker-compose-jihu.yml b/apps/gitlab/docker-compose-jihu.yml new file mode 100644 index 000000000..3ab5965fe --- /dev/null +++ b/apps/gitlab/docker-compose-jihu.yml @@ -0,0 +1,49 @@ +# image: https://hub.docker.com/r/gitlab/gitlab-ce +# docs: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/master/docker +# postgresql is in this container + +version: '3.8' + +services: + + gitlab: + image: registry.gitlab.cn/omnibus/gitlab-jh:$W9_VERSION + container_name: "$W9_ID" + hostname: "$W9_URL" + env_file: .env + environment: + GITLAB_OMNIBUS_CONFIG: | + # external_url rule: the protocol must be http://, can not use https:// + # external_url 'http://$W9_URL' + gitlab_rails['gitlab_shell_ssh_port'] = 22 + # Add any other gitlab.rb configuration here, each on its own line + # other + shm_size: '256m' + restart: unless-stopped + ports: + - '${W9_HTTP_PORT_SET}:80' + - '${W9_SSH_PORT_SET}:22' + volumes: + - gitlab_config:/etc/gitlab + - gitlab_logs:/var/log/gitlab + - gitlab_data:/var/opt/gitlab + + runner: + image: gitlab/gitlab-runner:latest + container_name: $W9_ID-runner + restart: unless-stopped + volumes: + - gitlab_runner:/etc/gitlab-runner + - /var/run/docker.sock:/var/run/docker.sock + env_file: .env + +networks: + default: + name: ${W9_NETWORK} + external: true + +volumes: + gitlab_config: + gitlab_logs: + gitlab_data: + gitlab_runner: \ No newline at end of file diff --git a/apps/gitlab/docker-compose.yml b/apps/gitlab/docker-compose.yml index 2d9eee089..d8a502adf 100644 --- a/apps/gitlab/docker-compose.yml +++ b/apps/gitlab/docker-compose.yml @@ -16,6 +16,7 @@ services: # external_url rule: the protocol must be http://, can not use https:// # external_url 'http://$W9_URL' gitlab_rails['gitlab_shell_ssh_port'] = 22 + gitlab_rails['initial_root_password'] = ${W9_LOGIN_PASSWORD} # Add any other gitlab.rb configuration here, each on its own line # other shm_size: '256m' diff --git a/apps/gitlab/variables.json b/apps/gitlab/variables.json index 42b976987..1aeb2c6c8 100644 --- a/apps/gitlab/variables.json +++ b/apps/gitlab/variables.json @@ -7,6 +7,10 @@ { "dist": "community", "version": ["16.6.2-ce.0","latest"] + }, + { + "dist": "jihu", + "version": ["16.6.2","latest"] } ], "requirements": { diff --git a/apps/gogs/.env b/apps/gogs/.env index be9378baf..c1182c9c5 100644 --- a/apps/gogs/.env +++ b/apps/gogs/.env @@ -6,10 +6,15 @@ W9_POWER_PASSWORD=F6xdFLjZwZPyRp #### -- Not allowed to edit below environments when recreate app based on existing data -- #### W9_ID=gogs -W9_SSH_PORT_SET=10022 +W9_SSH_PORT_SET=25 W9_HTTP_PORT_SET=9001 W9_HTTP_PORT=3000 W9_DB_EXPOSE="mysql" +W9_DB_VERSION="8" W9_URL=appname.example.com W9_NETWORK=websoft9 #### --------------------------------------------------------------------------------------- #### + +BACKUP_INTERVAL=7d +BACKUP_RETENTION=7d +RUN_CROND=true \ No newline at end of file diff --git a/apps/gogs/docker-compose.yml b/apps/gogs/docker-compose.yml index a50e785a4..541c30a5e 100644 --- a/apps/gogs/docker-compose.yml +++ b/apps/gogs/docker-compose.yml @@ -11,15 +11,11 @@ services: - ${W9_SSH_PORT_SET}:22 volumes: - gogs_data:/data - environment: - - BACKUP_INTERVAL=7d - - BACKUP_RETENTION=7d - - RUN_CROND=true restart: unless-stopped env_file: .env mysql: - image: mysql:5.7 + image: mysql:${W9_DB_VERSION} container_name: ${W9_ID}-mysql restart: unless-stopped command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci @@ -30,7 +26,6 @@ services: MYSQL_USER: ${W9_ID} MYSQL_PASSWORD: ${W9_POWER_PASSWORD} MYSQL_ROOT_PASSWORD: ${W9_POWER_PASSWORD} - env_file: .env networks: default: