mirror of
https://github.com/mgcrea/docker-compose-gitlab-ce.git
synced 2026-01-14 01:58:01 +00:00
feat(git): initial commit
This commit is contained in:
5
.env.default
Normal file
5
.env.default
Normal file
@ -0,0 +1,5 @@
|
||||
GITLAB_CE_VERSION=10.1.0-ce.0
|
||||
GITLAB_HOST=gitlab.mydomain.io
|
||||
GITLAB_SSH_PORT="5.135.123.160:22:22"
|
||||
LETSENCRYPT_EMAIL=contact@mydomain.io
|
||||
TZ=Europe/Paris
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
volumes/
|
||||
.env
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2017 Olivier Louvignes <olivier@mgcrea.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
40
README.md
Normal file
40
README.md
Normal file
@ -0,0 +1,40 @@
|
||||
# Compose file for Gitlab Community Edition
|
||||
|
||||
[](https://tldrlegal.com/license/mit-license)
|
||||
[](https://registry.hub.docker.com/u/gitlab/gitlab-ce/)
|
||||
[](https://registry.hub.docker.com/u/gitlab/gitlab-ce/)
|
||||
|
||||
Working `docker-compose.yml` for official [gitlab-ce](https://hub.docker.com/r/gitlab/gitlab-ce) docker images leveraging separate instances for services:
|
||||
|
||||
- Uses official [postgres](https://hub.docker.com/_/postgres/) docker image
|
||||
- Uses official [redis](https://hub.docker.com/_/redis/) docker image
|
||||
- Comes with a [gitlab-runner](https://hub.docker.com/gitlab/gitlab-runner/) instance
|
||||
|
||||
Made to work behind a separate automated [nginx-proxy](https://github.com/jwilder/nginx-proxy) with SSL support via letsencrypt.
|
||||
|
||||
|
||||
## Quickstart
|
||||
|
||||
- You can quickly start your compose gitlab instance (requires a working automated nginx_proxy compose instance)
|
||||
|
||||
```bash
|
||||
git clone -o git@github.com:mgcrea/docker-compose-gitlab-ce; cd $_
|
||||
cp .env.default .env; nano .env
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
|
||||
## Check postgres bundled version
|
||||
|
||||
```bash
|
||||
source .env
|
||||
docker run --rm -it gitlab/gitlab-ce:${GITLAB_CE_VERSION} postgres --version
|
||||
```
|
||||
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Gitlab installation](https://docs.gitlab.com/ce/install/docker.html)
|
||||
- [GitLab Docker images](https://docs.gitlab.com/omnibus/docker/)
|
||||
- [GitLab CI Docker images](https://docs.gitlab.com/ce/ci/docker/using_docker_images.html)
|
||||
- [Using a non-bundled web-server](https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server)
|
||||
65
docker-compose.yml
Normal file
65
docker-compose.yml
Normal file
@ -0,0 +1,65 @@
|
||||
# https://hub.docker.com/r/gitlab/gitlab-ce
|
||||
# https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server
|
||||
|
||||
version: '2.1'
|
||||
services:
|
||||
gitlab:
|
||||
image: gitlab/gitlab-ce:${GITLAB_CE_VERSION}
|
||||
restart: always
|
||||
container_name: gitlab
|
||||
hostname: 'gitlab.mgcrea.io'
|
||||
environment:
|
||||
- TZ=${TZ}
|
||||
- VIRTUAL_HOST=${GITLAB_HOST}
|
||||
- VIRTUAL_PORT=80
|
||||
- LETSENCRYPT_HOST=${GITLAB_HOST}
|
||||
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||
ports:
|
||||
- ${GITLAB_SSH_PORT}
|
||||
volumes:
|
||||
- './volumes/config:/etc/gitlab'
|
||||
- './volumes/logs:/var/log/gitlab'
|
||||
- './volumes/data:/var/opt/gitlab'
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
networks:
|
||||
- default
|
||||
- nginx_proxy
|
||||
|
||||
runner:
|
||||
image: gitlab/gitlab-runner:alpine-v10.1.0
|
||||
restart: always
|
||||
container_name: gitlab_runner
|
||||
environment:
|
||||
- CI_SERVER_URL=https://${GITLAB_HOST}/
|
||||
volumes:
|
||||
- ./volumes/runner:/etc/gitlab-runner
|
||||
- /var/run/docker.sock:/var/run/docker.sock:rw
|
||||
|
||||
postgres:
|
||||
image: postgres:9.6.5-alpine
|
||||
restart: always
|
||||
container_name: gitlab_postgresql
|
||||
# https://github.com/docker-library/docs/tree/master/postgres#environment-variables
|
||||
environment:
|
||||
- POSTGRES_USER=gitlab
|
||||
- POSTGRES_DB=gitlabhq_production
|
||||
volumes:
|
||||
- ./volumes/postgres:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
redis:
|
||||
image: redis:3-alpine
|
||||
restart: always
|
||||
container_name: gitlab_redis
|
||||
command:
|
||||
- --loglevel warning
|
||||
volumes:
|
||||
- ./volumes/redis:/var/lib/redis
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
nginx_proxy:
|
||||
external:
|
||||
name: nginxproxy_default
|
||||
0
volumes/config/.gitkeep
Normal file
0
volumes/config/.gitkeep
Normal file
0
volumes/data/.gitkeep
Normal file
0
volumes/data/.gitkeep
Normal file
0
volumes/logs/.gitkeep
Normal file
0
volumes/logs/.gitkeep
Normal file
0
volumes/postgres/.gitkeep
Normal file
0
volumes/postgres/.gitkeep
Normal file
0
volumes/redis/.gitkeep
Normal file
0
volumes/redis/.gitkeep
Normal file
0
volumes/runner/.gitkeep
Normal file
0
volumes/runner/.gitkeep
Normal file
Reference in New Issue
Block a user