由于威联通首页的gitlab容器无自定义设置且无挂载路径,而且内部git地址显示localhost显示
故修改原有docke-compose.yml文件
这里添加了三个容器的挂载路径,将重要文件挂载至磁盘路径,防止容器损毁丢失数据
路径在/share/Container/container-station-data/Mount/Gitlab/下创建对应文件夹即可
GITLAB_HOST 填写NAS的IP地址
GITLAB_PORT 填写页面访问端口
GITLAB_SSH_PORT SSH连接gitlab的端口,一般用不到
gitlab:
environment:
DEBUG: 'false'
GITLAB_PORT: 10080
GITLAB_SECRETS_DB_KEY_BASE: qcs-gitlab-app
GITLAB_SECRETS_OTP_KEY_BASE: qcs-gitlab-app
GITLAB_SECRETS_SECRET_KEY_BASE: qcs-gitlab-app
GITLAB_SSH_PORT: 10022
GITLAB_HOST: 192.168.2.234
image: sameersbn/gitlab:11.4.0
links:
- redis:redisio
- postgresql:postgresql
ports:
- "10080:80"
- "10022:22"
volumes:
- /share/Container/container-station-data/Mount/Gitlab/data:/home/git/data:Z
restart: always
postgresql:
environment:
DB_EXTENSION: pg_trgm
DB_NAME: gitlabhq_production
DB_PASS: password
DB_USER: gitlab
image: sameersbn/postgresql:9.6-2
volumes:
- /share/Container/container-station-data/Mount/Gitlab/postgresql:/var/lib/postgresql:Z
restart: always
redis:
command:
- --loglevel warning
image: sameersbn/redis:latest
volumes:
- /share/Container/container-station-data/Mount/Gitlab/redis:/var/lib/redis:Z
restart: always
这里直接用上方yaml文件创建即可(修改原yaml存在无法重新生成挂载配置的问题)
文件被正常挂载出来
由于yaml中端口配置为10080
ports:
- “10080:80”
- “10022:22”
创建完成后访问http://NAS的IP:10080即可正常使用
gitlab启动较慢,如无法打开或显示502则需要等待一会,多次刷新还是502需检查内存是否足够,gitlab需要1.5G-2G内存