requarks / wiki

Wiki.js | A modern and powerful wiki app built on Node.js
https://js.wiki
GNU Affero General Public License v3.0
24.33k stars 2.69k forks source link

WikiJS with a GitLab Docker #455

Closed AlexisPoyen closed 6 years ago

AlexisPoyen commented 6 years ago

Actual behavior

In our company we have decided to use WikiJS with docker and to have a backup in GitLab also in a container.

The problem is that GitLab take a while to be ready and since that WikiJS is not able to pull from GitLab (which is not yet accessible) all content isn't load in WikiJS (/all is empty) except for the home page which is still accessible. After checking manually that GitLab is ready, restart the WikiJS container make everything works, but we are looking for a more automatic process. Currently we use a wait-for-it.sh to restart WikiJS when GitLab is ready, what is not recommended by Docker (see docker-compose doc here).

Expected behavior

According to docker-compose documentation what they recommend is to have a application that is resilient and do not have to wait for other services. Maybe display what is inside repo directory locally while Git isn't accessible.

Steps to reproduce the behavior

This is the docker-compose.yml:

version: '3.1'  
services:  
  wikidb:  
    image: mongo  
    restart: always  
    expose:  
      - '27017'  
    command: '--smallfiles --bind_ip wikidb'
    environment:
      - 'MONGO_LOG_DIR=/dev/null'
    volumes:
      - ./data/mongo:/data/db
  wikijs:
    image: 'requarks/wiki:latest'
    restart: always
    depends_on:
      - gitlab
      - wikidb
    ports:
      - '80:80'
    environment:
      WIKI_ADMIN_EMAIL: admin@example.com
    volumes:
      - ./config.yml:/var/wiki/config.yml
      - ./repo/:/var/wiki/repo
      - ./wait-for-it.sh:/root/wait-for-it.sh
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'hostname'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.comany.fr:8000'
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
        gitlab_rails['gitlab_port'] = 8000
    ports:
      - '8000:8000'
      - '4443:443'
      - '2222:22'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
NGPixel commented 6 years ago

Duplicate of #348