GitLab Deployment Example

This guide demonstrates how to deploy a GitLab instance using Instantly.run.

Deployment Command

docker run --context=instantly --name gitlab-server --domainname git.example.com \
-e GITLAB_OMNIBUS_CONFIG="external_url 'https://git.example.com';" \
-p 8443:443 -p 80:80 -p 22:22 -v nas:/var/opt/gitlab

Command Breakdown

  • --context=instantly: Ensures the container is managed under the Instantly.run context.
  • --name gitlab-server: Assigns the container a unique name for reference.
  • --domainname git.example.com: Assigns the container a public domain.
  • Environment Variables:
    • GITLAB_OMNIBUS_CONFIG: Configures GitLab with the specified external URL.
  • -p 8443:443: Maps GitLab's HTTPS port to the host.
  • -p 80:80: Maps GitLab's HTTP port to the host.
  • -p 22:22: Maps GitLab's SSH port to the host.
  • -v nas:/var/opt/gitlab: Mounts a volume to persist GitLab data.

Accessing the Deployment

  • Public Domain: Once deployed, your GitLab instance will be accessible at https://git.example.com.
  • Automatic SSL: An SSL certificate will be automatically generated for the domain, and HTTP traffic will redirect to HTTPS.

Modifying the Deployment

To make updates (e.g., change the external URL or add volumes), re-run the command with updated parameters. For example, to change the volume mapping:

docker run --context=instantly --name gitlab-server --domainname git.example.com \
-e GITLAB_OMNIBUS_CONFIG="external_url 'https://git.example.com';" \
-p 8443:443 -p 80:80 -p 22:22 -v hdd:/var/opt/gitlab

Additional Configuration

For more configuration options, refer to the GitLab Docker Documentation.