Skip to content

Commit

Permalink
fix gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Dec 21, 2023
1 parent d73f6f6 commit 3775119
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 16 deletions.
13 changes: 4 additions & 9 deletions apps/gitlab/.env
Original file line number Diff line number Diff line change
@@ -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 -- ####

Expand All @@ -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
Expand Down
49 changes: 49 additions & 0 deletions apps/gitlab/docker-compose-enterprise.yml
Original file line number Diff line number Diff line change
@@ -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:
49 changes: 49 additions & 0 deletions apps/gitlab/docker-compose-jihu.yml
Original file line number Diff line number Diff line change
@@ -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:
1 change: 1 addition & 0 deletions apps/gitlab/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions apps/gitlab/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"dist": "community",
"version": ["16.6.2-ce.0","latest"]
},
{
"dist": "jihu",
"version": ["16.6.2","latest"]
}
],
"requirements": {
Expand Down
7 changes: 6 additions & 1 deletion apps/gogs/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions apps/gogs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 3775119

Please sign in to comment.