Reverse Proxy


Reverse Proxy in front of GitLab

Central service for…

Examples in this workshop use traefik

traefik is configured using container labels


Deployment

Services are reachable by…

Deploy using docker compose v2:

docker rm -f gitlab
docker compose --project-name gitlab up -d

Your VM has the necessary environment variables: DOMAIN and IP

Extract password:

docker compose --project-name gitlab exec gitlab
    cat /etc/gitlab/initial_root_password \
    | grep ^Password | cut -d' ' -f2

Starting fresh

Stop running instance:

docker compose --project-name gitlab down

Purge data by removing volumes:

docker volume rm gitlab_config
docker volume rm gitlab_logs
docker volume rm gitlab_data

A fresh instance has a new initial root password

docker exec -it gitlab cat /etc/gitlab/initial_root_password \
| grep ^Password \
| cut -d' ' -f2

TLS

Not configured in this workshop

Multiple options

GitLab with certificate file

Configure GitLab with key and certificate

GitLab with Let’s Encrypt

Configure GitLab to use Let’s Encrypt

traefik with Let’s Encrypt

Configure traefik to use Let’s Encrypt with HTTP challenge

Configure traefik to use Let’s Encrypt with DNS challenge


Local IDE

Use local Visual Studio Code with Remote SSH plugin

  1. Create SSH connection: F1 -> Remote-SSH: Open SSH Configuration File
  2. Select user file
  3. Add host:

     Host seat
         HostName ${IP}
         User root
         StrictHostKeyChecking no
         UserKnownHostsFile /dev/null
    
  4. Connect to host: F1 -> Remote-SSH: Connect to Host
  5. Select host called seat and enter password

Hosted IDE

Visual Studio Code Web can be deployed as well

Add code-server to running instance:

docker compose --project-name gitlab \
    --file compose.yml \
    --file compose.vscode.yml \
    up -d

Accessible at http://vscode.seatN.inmylab.de

Retrieve password:

docker compose --project-name gitlab \
    --file compose.yml \
    --file compose.vscode.yml \
    exec vscode \
        cat /root/.config/code-server/config.yaml