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.24k stars 2.68k forks source link

Cannot start with docker-compose.yml #472

Closed kopax closed 6 years ago

kopax commented 6 years ago

I have the following docker-compose.yml:

version: '3'
services:
  wikidb:
    image: mongo
    expose:
      - '27017'
    command: '--smallfiles --bind_ip wikidb'
    environment:
      - 'MONGO_LOG_DIR=/dev/null'
    volumes:
      - ./data/mongo:/data/db
  wikijs:
    image: 'requarks/wiki:latest'
    links:
      - wikidb
    depends_on:
      - wikidb
    ports:
      - '80:3000'
    environment:
      WIKI_ADMIN_EMAIL: admin@example.com
    volumes:
      - /srv/deploy/ssl/GandiStandardSSLCA2.pem:/etc/ssl/GandiStandardSSLCA2.pem
      - ./config.yml:/var/wiki/config.yml
      - ./repo:/repo
      - ./data:/data

I took the sample from this address I want to access the service on port 80

Problem

curl -v -I http://localhost
* Rebuilt URL to: http://localhost/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 80 (#0)
> HEAD / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0

Expected

200

Logs

dc logs -f
Attaching to wiki_wikijs_1, wiki_wikidb_1
wikijs_1  | 2018-03-22 20:54:30,896 CRIT Supervisor running as root (no user in config file)
wikijs_1  | 2018-03-22 20:54:30,916 INFO RPC interface 'supervisor' initialized
wikijs_1  | 2018-03-22 20:54:30,916 CRIT Server 'unix_http_server' running without any HTTP authentication checking
wikijs_1  | 2018-03-22 20:54:30,916 INFO supervisord started with pid 1
wikijs_1  | 2018-03-22 20:54:31,919 INFO spawned: 'wikijs' with pid 9
wikijs_1  | 2018-03-22 20:54:32,939 INFO success: wikijs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8147f9d7de19
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] db version v3.6.3
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] allocator: tcmalloc
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] modules: none
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] build environment:
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten]     distmod: debian81
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten]     distarch: x86_64
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten]     target_arch: x86_64
wikidb_1  | 2018-03-22T20:54:27.847+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "wikidb" }, storage: { mmapv1: { smallFiles: true } } }
wikidb_1  | 2018-03-22T20:54:27.858+0000 I STORAGE  [initandlisten] 
wikidb_1  | 2018-03-22T20:54:27.858+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
wikidb_1  | 2018-03-22T20:54:27.858+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
wikidb_1  | 2018-03-22T20:54:27.858+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3305M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
wikidb_1  | 2018-03-22T20:54:29.738+0000 W STORAGE  [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] 
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] 
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] 
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
wikidb_1  | 2018-03-22T20:54:29.738+0000 I CONTROL  [initandlisten] 
wikidb_1  | 2018-03-22T20:54:29.738+0000 I STORAGE  [initandlisten] createCollection: admin.system.version with provided UUID: 41f97d07-a2b5-4260-a0c1-15a680ac4fd2
wikidb_1  | 2018-03-22T20:54:29.938+0000 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.6
wikidb_1  | 2018-03-22T20:54:29.945+0000 I STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: 90ce24eb-b311-4245-83d6-578806a520a2
wikidb_1  | 2018-03-22T20:54:30.143+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
wikidb_1  | 2018-03-22T20:54:30.144+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
kopax commented 6 years ago

Issue was local port in config.yml needed to be switch from 80 (default) to 3000 (in my case).