Skip to content

Self‑hosted GitLab stack (CE) packaged with Docker Compose for fast local or medium‑scale deployments.

Notifications You must be signed in to change notification settings

amintoorchi/Gitlab-ce-dockerized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Gitlab‑ce Dockerized

Self‑hosted GitLab stack (CE) packaged with Docker Compose for fast local or medium‑scale deployments.

Build Status License Version


Table of contents


What the project does

Gitlab‑ce Dockerized provides a minimal, reproducible Docker Compose stack that runs:

  • GitLab (official Docker image)
  • PostgreSQL (database)
  • Redis (cache and job queue)

It wires these services together using a named Docker network and mounts persistent volumes so data survives container restarts.


Why this is useful

  • Start a full GitLab instance locally in minutes for development, testing, or small self‑hosted usage.
  • All configuration is controlled via environment variables for easy customization.
  • Uses official images (GitLab, Postgres, Redis) with persistent volumes for safety.
  • Designed to be simple and opinionated so it’s easy to adapt to your environment.

Quick start

Prerequisites

  • Docker Engine (20.x+)
  • Docker Compose (v1.27+ or Compose v2)
  • Basic knowledge of Docker and port configuration
  • A Docker network named gitlab_network (the compose file expects this; instructions below create it)

Configuration

  1. Clone the repository
git clone https://github.com/amintoorchi/Gitlab-ce-dockerized.git
cd Gitlab-ce-dockerized
  1. Copy the example environment file and edit it
cp .env.example .env
# Edit .env and fill in DB_PASSWORD, GITLAB_ROOT_PASSWORD, HOST_NAME, SSH_PORT, GUI_PORT, BASE_VOLUMES_PATH, EXTERNAL_URL, etc.

See .env.example for all available variables and guidance.

Create network & start

This project expects an external Docker network called gitlab_network. Create it if missing:

docker network create gitlab_network

Start the stack:

docker-compose up -d
  • Web UI: http://<HOST_NAME>:<GUI_PORT> (or use EXTERNAL_URL)
  • SSH: <HOST_NAME> on port <SSH_PORT> (mapped to container SSH 22)

Example snippet (key service config)

The Compose configuration maps ports, mounts persistent volumes and sets the GitLab Omnibus config via environment. Example excerpt:

services:
  gitlab:
    image: gitlab/gitlab-ee:latest
    container_name: gitlab
    hostname: ${HOST_NAME}
    restart: unless-stopped
    shm_size: "${SHM_SIZE}"
    ports:
      - "${SSH_PORT}:22"
      - "${GUI_PORT}:80"
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url '${EXTERNAL_URL}'
        gitlab_rails['db_password'] = '${DB_PASSWORD}'
        gitlab_rails['initial_root_password'] = "${GITLAB_ROOT_PASSWORD}"

You can view the full Compose file at docker-compose.yml.

Updating and stopping

  • Pull new images and restart:
docker-compose pull
docker-compose up -d
  • Stop and remove containers:
docker-compose down

Volumes remain on disk (under the path you set with BASE_VOLUMES_PATH) unless explicitly removed.


Key files

  • docker-compose.yml — main Compose stack (GitLab, Postgres, Redis)
  • .env.example — example environment variables (copy to .env and edit)

Both files are in the repository root and are the primary configuration surface for the stack.


Where to get help


Maintainers & contributing

  • Maintained by: amintoorchi (GitHub: @amintoorchi)
  • Contributions welcome — please open issues or PRs.
  • If you have project-specific contribution rules, add a CONTRIBUTING.md file. In the meantime, use GitHub Issues to discuss changes.

Notes & best practices

  • Use strong, unique passwords in .env and protect this file (do not commit secrets).
  • For production use, consider:
    • Using GitLab Enterprise or an externally managed database per GitLab recommendations.
    • Adding backups for PostgreSQL and /var/opt/gitlab data.
    • Placing GitLab behind a reverse proxy (Nginx, Traefik) and enabling HTTPS / LetsEncrypt.

If you want, I can:

  • Open a pull request that replaces the current minimal README with this expanded version, or
  • Commit the README directly to the repository (I will need repo write access).

About

Self‑hosted GitLab stack (CE) packaged with Docker Compose for fast local or medium‑scale deployments.

Resources

Stars

Watchers

Forks