Skip to content





Table of Content

gitlab on docker compose

docker compose yaml file

date 2024-10-16

  • create volumes before docker compose up -d
    • docker volume create v_data
    • docker volume create v_logs
    • docker volume create v_config
  • the service listens on port 80 only using plain http
    • expected to use reverse proxy with TLS offload

See https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html for the restoration procedure. Find the version from the filename of the backup file stored in a cloud storage.

docker-compose.yml
services:
  SERVICE_NAME_HERE:
    image: gitlab/gitlab-ee:TAG
    restart: always
    hostname: HOSTNAME_HERE
    container_name: CONTAINER_NAME_HERE
    shm_size: "256m"
    dns:
      - ipaddr_of_dns_service
      - ipaddr_of_dns_service
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://HOSTNAME_HERE'
    ports:
      - "80:80"
    volumes:
      - type: volume
        source: v_config
        target: /etc/gitlab
      - type: volume
        source: v_data
        target: /var/opt/gitlab
      - type: volume
        source: v_logs
        target: /var/log/gitlab
    networks:
      - gitlab-network

volumes:
  v_data: {}
  v_logs: {}
  v_config: {}

networks:
  gitlab-network:
    name: gitlab-network