requarks / wiki-v1

Legacy version (1.x) of Wiki.js
https://wiki.js.org
GNU Affero General Public License v3.0
101 stars 75 forks source link

504 request times out #132

Open johnshumon opened 5 years ago

johnshumon commented 5 years ago

-- I'm trying to run on docker locally in my machine. -- MacBook pro 2018 with latest docker and docker-compose installed.

I have followed through steps mentioned in the documentation. Only thing I have changed is the port number. Then again tried with default port 80. nothing changed!

Where am I going wrong?

Actual behavior

Following is my docker-compose.yml file:

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

This is my how my config.yml looks like:

title: Wiki
host: http://localhost:3000
port: 3000
paths:
  repo: ./repo
  data: ./data
uploads:
  maxImageFileSize: 3
  maxOtherFileSize: 100
lang: en

# Enable for right to left languages (e.g. arabic):
langRtl: false

public: false
auth:
  defaultReadAccess: false
  local:
    enabled: true
sessionSecret: 1234567890abcdefghijklmnopqrstuvxyz

db: mongodb://localhost:27017/wiki

features:
  linebreaks: true
  mathjax: true

externalLogging:
  bugsnag: false
  loggly: false
  papertrail: false
  rollbar: false
  sentry: false

theme:
  primary: indigo
  alt: blue-grey
  viewSource: all # all | write | false
  footer: blue-grey
  code:
    dark: true
    colorize: true

Expected behavior

Display the landing page.

johnshumon commented 5 years ago

reason I opted out git config in config.yml is because it's not a concern at the moment. I'm trying to just launch the application in docker container. But seems it's not happening!

gkoerk commented 5 years ago

I think this may be the same as the gateway timeout I'm experiencing when using docker (but not npm install.

johnshumon commented 5 years ago

@gkoerk I haven't tried directly as a node application. I would like to have it as a docker container as it gives much isolation and portability.

pauloricardonoe commented 5 years ago

Managed to solve?

johnshumon commented 5 years ago

@gkoerk No not yet! That's why asking for help or hint.

maxidev commented 5 years ago

+1 exact same error here.

pauloricardonoe commented 5 years ago

@gkoerk Ainda não! É por isso que pede ajuda ou sugestão.

I'm also having the same problem.

mohdhallal commented 5 years ago

Hello,

Facing the same issue.

Looks like the node application on the wikijs container is crashing right after it attempts to establish a connection with wikidb. I found the below error in the wikijs container:

2018-11-17T18:18:41.891Z - error: [AGENT] Failed to connect to MongoDB instance.
Unhandled rejection MongoError: failed to connect to server [wikidb:27017] on first connect [MongoError: connect ECONNREFUSED 172.21.0.2:27017]

Basically, mongo is still initializing when wikijs attempts to connect which causes it to crash. reconnectTries option does not work in this case.

The issue is described here And debated on mongoose here. From the way the discussion is going, looks like this needs to be handled somewhere here

johnshumon commented 5 years ago

@NGPixel or any other contributor, any update or pointer on this one how to run wikijs on docker?

brendanwelsh commented 5 years ago

Same error here.

gohackfelipe commented 5 years ago

+1

wildskyf commented 4 years ago

[This Might Help] Try use port 80, not use 4000 or other port num is more than 1024

ref: https://github.com/Requarks/wiki/issues/923