feat(git): initial commit

This commit is contained in:
Olivier Louvignes
2017-10-31 11:27:25 +01:00
commit 2112245a72
11 changed files with 133 additions and 0 deletions

5
.env.default Normal file
View 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
View File

@ -0,0 +1,2 @@
volumes/
.env

21
LICENSE Normal file
View 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
View File

@ -0,0 +1,40 @@
# Compose file for Gitlab Community Edition
[![License](https://img.shields.io/github/license/mgcrea/docker-compose-gitlab-ce.svg?style=flat)](https://tldrlegal.com/license/mit-license)
[![Docker Stars](https://img.shields.io/docker/stars/gitlab/gitlab-ce.svg)](https://registry.hub.docker.com/u/gitlab/gitlab-ce/)
[![Docker Pulls](https://img.shields.io/docker/pulls/gitlab/gitlab-ce.svg)](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
View 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
View File

0
volumes/data/.gitkeep Normal file
View File

0
volumes/logs/.gitkeep Normal file
View File

View File

0
volumes/redis/.gitkeep Normal file
View File

0
volumes/runner/.gitkeep Normal file
View File