version: '3.6'
services:
  gitlab_ce:
    image: 'gitlab/gitlab-ce:latest'
    restart: unless-stopped
    hostname: 'gitlab.knast.cc'
    environment:
      GITLAB_OMNIBUS_CONFIG: 
        external_url 'https://gitlab.knast.cc'
    networks:
      - traefik
    ports:
      - "2222:22"
    # ports:
    #   - '80:80'
    #   - '443:443'
    #   - '22:22'
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.gitlab.entrypoints=websecure"
      - "traefik.http.routers.gitlab.rule=Host(`gitlab.$DOMAIN_NAME`, `registry.gitlab.$DOMAIN_NAME`)"
      - "traefik.http.routers.gitlab.tls.certresolver=letsencr"
      - "traefik.http.services.gitlab.loadbalancer.server.port=80"
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'
    
networks:
  traefik:
    external: true
