Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Created January 7, 2017 21:18
Show Gist options
  • Save darth-veitcher/3c10a78fe61da66f94decb9ca089dc48 to your computer and use it in GitHub Desktop.
Save darth-veitcher/3c10a78fe61da66f94decb9ca089dc48 to your computer and use it in GitHub Desktop.
self-hosted GitLab setup

Gitlab Setup

# Grab the latest image
docker pull gitlab/gitlab-ce:latest

# Create directory structure
cd /data
mkdir -p gitlab && cd gitlab
mkdir -p {config,logs,data}

# Run the container
docker run --detach \
    --hostname git.mydomain.tld \
    --publish 127.0.0.1:8181:80 --publish 127.0.0.1:2289:22 \
    --name gitlab \
    --restart always \
    --volume /data/gitlab/config:/etc/gitlab \
    --volume /data/gitlab/logs:/var/log/gitlab \
    --volume /data/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

Super Caddy

git.mydomain.tld {
    log git.access.log {
        rotate
    }

    errors {
        log git.errors.log
    }

    tls [email protected]

    proxy / 127.0.0.1:8181 {
        fail_timeout 300s

        proxy_header Host {host}
        proxy_header X-Real-IP {remote}
        proxy_header X-Forwarded-Proto {scheme}
        proxy_header X-Forwarded-Ssl on
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment