Skip to content
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

[Op#53021] Define Gitlab CE local docker compose setup with TLS #14846

Merged
merged 6 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions docker/dev/gitlab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-compose.override.yml
37 changes: 37 additions & 0 deletions docker/dev/gitlab/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3.9"

services:
gitlab:
image: gitlab/gitlab-ce:latest
restart: no
volumes:
- gitlab-etc:/etc/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-opt:/var/opt/gitlab
# Linux
- /etc/ssl/certs:/etc/ssl/certs:ro
- /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro
# In case of MacOS, you need to mount the certs from the host machine
# having them previously bundled via `sudo update-ca-certificates`
#
# - ~/.step/certs:/etc/ssl/certs
# - ~/.step/certs:/usr/local/share/ca-certificates
networks:
- external
extra_hosts:
- "openproject.local:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitlab.rule=Host(`gitlab.local`)"
- "traefik.http.routers.gitlab.entrypoints=websecure"
- "traefik.http.services.gitlab.loadbalancer.server.port=80"
akabiru marked this conversation as resolved.
Show resolved Hide resolved

volumes:
gitlab-etc:
gitlab-logs:
gitlab-opt:

networks:
external:
name: gateway
external: true
2 changes: 2 additions & 0 deletions docker/dev/tls/docker-compose.override.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ services:
# by connecting to them, and we'd like it to go through traefik, instead
# of calling the service containers directly.
- openproject.local
- nextcloud.local
- gitlab.local
31 changes: 29 additions & 2 deletions docs/development/development-environment-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ cp docker-compose.override.example.yml docker-compose.override.yml
# and will install all required server dependencies
docker compose run --rm backend setup

# This will install the web dependencies
# This will install the web dependencies
docker compose run --rm frontend npm install
```

Expand Down Expand Up @@ -307,7 +307,7 @@ On Debian, you need to add the generated root CA to system certificates bundle.
docker compose --project-directory docker/dev/tls cp \
step:/home/step/certs/root_ca.crt /usr/local/share/ca-certificates/OpenProject_Development_Root_CA.crt

# Create symbolic link
# Create symbolic link
ln -s /usr/local/share/ca-certificates/OpenProject_Development_Root_CA.crt /etc/ssl/certs/OpenProject_Development_Root_CA.pem

# Update certificate bundle
Expand Down Expand Up @@ -394,6 +394,33 @@ docker compose --project-directory docker/dev/tls down
docker compose --project-directory docker/dev/tls up -d
```

## GitLab CE Service

Within `docker/dev/gitlab` a compose file is provided for running local Gitlab instance with TLS support. The provides
akabiru marked this conversation as resolved.
Show resolved Hide resolved
a production like environment for testing the OpenProject GitLab integration against a community edition gitlab instance
akabiru marked this conversation as resolved.
Show resolved Hide resolved
accessible on `https://gitlab.local`.

> NOTE: Configure [TLS Support](#tls-support) first before starting the GitLab service

See [Install GitLab using Docker Compose](https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-compose)
official GitLab documentation.

### Running the GitLab Instance

Start up the docker compose service for gitlab as follows:

```shell
docker compose --project-directory docker/dev/gitlab up -d
```

### Initial password

Once the GitLab service is started and running, you can access the initial `root` user password as follows:

```shell
docker compose --project-directory docker/dev/gitlab exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
```

## Local files

Running the docker images will change some of your local files in the mounted code directory. The
Expand Down
Loading