Skip to content

Add mattermost and registry conf #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .env.dist
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
GITLAB_HOSTNAME=my.domain.tld
DOMAIN=domain.tld
GITLAB_SUBDOMAIN=gitlab
GITLAB_SSH_PORT=22
# To enable Mattermost set `true`. To disable Mattermost leave empty.
MATTERMOST_ENABLE=
MATTERMOST_SUBDOMAIN=mattermost
# To enable Registry set `true`. To disable Registry leave empty.
REGISTRY_ENABLE=
REGISTRY_STORAGE_ACCESS_KEY=s3-access-key
REGISTRY_STORAGE_BUCKET=your-s3-bucket
REGISTRY_STORAGE_REGION=your-s3-region
REGISTRY_STORAGE_REGION_ENDPOINT=your-s3-regionendpoint
REGISTRY_STORAGE_SECRET_KEY=s3-secret-key-for-access-key
REGISTRY_SUBDOMAIN=registry

COMPOSE_FILE=compose.yml${MATTERMOST_ENABLE:+:compose.mattermost.yml}${REGISTRY_ENABLE:+:compose.registry.yml}
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
container:
image: docker:latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Check Docker Compose file syntax
run: docker compose --env-file .env.dist config -q
check-markdown-syntax:
Expand All @@ -17,6 +18,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Markdown
uses: articulate/actions-markdownlint@v1
uses: DavidAnson/markdownlint-cli2-action@v13
with:
files: '**/*.md'
globs: '**/*.md'
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"mikestead.dotenv",
"ymotongpoo.licenser",
"davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml"
],
"unwantedRecommendations": [

]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"licenser.projectName": "GitLab with Docker Compose",
"licenser.license": "GPLv3"
}
16 changes: 0 additions & 16 deletions NOTICE

This file was deleted.

37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
<!-- markdownlint-disable-next-line MD001 -->
#### Table of Contents

1. [Description](#description)
2. [Setup](#setup)
3. [Usage](#usage)
4. [Reference](#reference)
5. [Development](#development)
6. [Contributors](#contributors)
- [GitLab with Docker Compose](#gitlab-with-docker-compose)
- [Table of Contents](#table-of-contents)
- [Description](#description)
- [Setup](#setup)
- [Usage](#usage)
- [Reference](#reference)
- [Environment variables](#environment-variables)
- [Development](#development)
- [Contributors](#contributors)

## Description

Expand Down Expand Up @@ -36,13 +39,21 @@ docker compose up -d

### Environment variables

#### `GITLAB_HOSTNAME`

The GitLab hostname. Default value: 'my.domain.tld'

#### `GITLAB_SSH_PORT`

The GitLab SSH port for git. Default value: '22'
| Name | Description | Default value |
| ---------------------------------- | ------------------------------------------------------------------- | ------------------------------ |
| `DOMAIN` | The GitLab domain | `domain.tld` |
| `GITLAB_SUBDOMAIN` | The GitLab subdomain | `gitlab` |
| `GITLAB_SSH_PORT` | The GitLab SSH port for git. | `22` |
| `MATTERMOST_ENABLE` | To enable Mattermost set `true`. To disable Mattermost leave empty. | |
| `MATTERMOST_SUBDOMAIN` | The Mattermost subdomain | `mattermost` |
| `REGISTRY_ENABLE` | To enable Registry set `true`. To disable Registry leave empty. | |
| `REGISTRY_SUBDOMAIN` | The Mattermost subdomain | `registry` |
| `REGISTRY_STORAGE_ACCESS_KEY` | The S3 access key | `s3-access-key` |
| `REGISTRY_STORAGE_BUCKET` | The S3 bucket | `your-s3-bucket` |
| `REGISTRY_STORAGE_REGION` | The S3 region | `your-s3-region` |
| `REGISTRY_STORAGE_REGION_ENDPOINT` | The S3 region endpoint | `your-s3-regionendpoint` |
| `REGISTRY_STORAGE_SECRET_KEY` | The S3 secret key | `s3-secret-key-for-access-key` |
| `REGISTRY_SUBDOMAIN` | The Registry subdomain | `registry` |

## Development

Expand Down
27 changes: 27 additions & 0 deletions compose.mattermost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2023 Solution Libre <[email protected]>
#
# This file is part of GitLab with Docker Compose.
#
# GitLab with Docker Compose is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GitLab with Docker Compose is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GitLab with Docker Compose. If not, see <https://www.gnu.org/licenses/>.

services:
web:
# Traefik labels are suggested as an example for people using Traefik,
# remove them if you are using another reverse proxy.
labels:
traefik.http.routers.gitlab-mattermost.entrypoints: websecure
traefik.http.routers.gitlab-mattermost.rule: "Host(`${MATTERMOST_SUBDOMAIN}.${DOMAIN}`)"
traefik.http.routers.gitlab-mattermost.service: gitlab-mattermost
traefik.http.routers.gitlab-mattermost.tls.certresolver: myresolver
traefik.http.services.gitlab-mattermost.loadbalancer.server.port: 8065
27 changes: 27 additions & 0 deletions compose.registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2023 Solution Libre <[email protected]>
#
# This file is part of GitLab with Docker Compose.
#
# GitLab with Docker Compose is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GitLab with Docker Compose is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GitLab with Docker Compose. If not, see <https://www.gnu.org/licenses/>.

services:
web:
# Traefik labels are suggested as an example for people using Traefik,
# remove them if you are using another reverse proxy.
labels:
traefik.http.routers.gitlab-registry.entrypoints: websecure
traefik.http.routers.gitlab-registry.rule: "Host(`${REGISTRY_SUBDOMAIN}.${DOMAIN}`)"
traefik.http.routers.gitlab-registry.service: gitlab-registry
traefik.http.routers.gitlab-registry.tls.certresolver: myresolver
traefik.http.services.gitlab-registry.loadbalancer.server.port: 5000
88 changes: 88 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Copyright (C) 2018-2023 Solution Libre <[email protected]>
#
# This file is part of GitLab with Docker Compose.
#
# GitLab with Docker Compose is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GitLab with Docker Compose is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GitLab with Docker Compose. If not, see <https://www.gnu.org/licenses/>.

services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: unless-stopped
hostname: "${GITLAB_SUBDOMAIN}.${DOMAIN}"
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['gitlab_shell_ssh_port'] = ${GITLAB_SSH_PORT}
external_url "https://${GITLAB_SUBDOMAIN}.${DOMAIN}"
mattermost['enable'] = ${MATTERMOST_ENABLE:-false}
mattermost['gitlab_auth_endpoint'] = "http://${GITLAB_SUBDOMAIN}.${DOMAIN}/oauth/authorize"
mattermost['gitlab_token_endpoint'] = "http://${GITLAB_SUBDOMAIN}.${DOMAIN}/oauth/token"
mattermost['gitlab_user_api_endpoint'] = "http://${GITLAB_SUBDOMAIN}.${DOMAIN}/api/v4/user"
mattermost['service_address'] = "0.0.0.0"
mattermost_external_url "https://${MATTERMOST_SUBDOMAIN}.${DOMAIN}"
mattermost_nginx['enable'] = false
nginx['listen_port'] = '80'
nginx['listen_https'] = false
registry['enable'] = ${REGISTRY_ENABLE:-false}
registry['registry_http_addr'] = "0.0.0.0:5000"
registry['storage'] = {
's3' => {
'accesskey' => '${REGISTRY_STORAGE_ACCESS_KEY}',
'secretkey' => '${REGISTRY_STORAGE_SECRET_KEY}',
'bucket' => '${REGISTRY_STORAGE_BUCKET}',
'region' => '${REGISTRY_STORAGE_REGION}',
'regionendpoint' => '${REGISTRY_STORAGE_REGION_ENDPOINT}'
}
}
registry_external_url "https://${REGISTRY_SUBDOMAIN}.${DOMAIN}"
registry_nginx['enable'] = false
# Traefik labels are suggested as an example for people using Traefik,
# remove them if you are using another reverse proxy.
labels:
traefik.enable: true
traefik.http.routers.gitlab.entrypoints: websecure
traefik.http.routers.gitlab.rule: "Host(`${GITLAB_SUBDOMAIN}.${DOMAIN}`)"
traefik.http.routers.gitlab.tls.certresolver: myresolver
traefik.http.services.gitlab.loadbalancer.server.port: 80
# If you don't want to use a reverse proxy (not suitable for production!)
# ports:
# - "80:80"
networks:
- default
- web
ports:
- ${GITLAB_SSH_PORT}:22
volumes:
- web_config:/etc/gitlab
- web_logs:/var/log/gitlab
- web_data:/var/opt/gitlab

runner:
image: 'gitlab/gitlab-runner:latest'
networks:
- runner
restart: unless-stopped
volumes:
- runner_config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock

networks:
runner:
web:
external: true

volumes:
runner_config:
web_config:
web_data:
web_logs:
60 changes: 0 additions & 60 deletions docker-compose.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.