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

Error when using docker #204

Closed ChristianAEDev closed 7 years ago

ChristianAEDev commented 7 years ago

First of all: Thank you for providing a way to deploy to Docker!!!

Actual behavior

When trying to deploy wiki.js using Docker I get the following error:

wikijs_1          | { Error: EISDIR: illegal operation on a directory, read
wikijs_1          |     at Object.fs.readSync (fs.js:681:18)
wikijs_1          |     at tryReadSync (fs.js:542:20)
wikijs_1          |     at Object.fs.readFileSync (fs.js:585:19)
wikijs_1          |     at module.exports (/var/wiki/server/libs/config.js:28:12)
wikijs_1          |     at Object.<anonymous> (/var/wiki/server/index.js:23:39)
wikijs_1          |     at Module._compile (module.js:573:30)
wikijs_1          |     at Object.Module._extensions..js (module.js:584:10)
wikijs_1          |     at Module.load (module.js:507:32)
wikijs_1          |     at tryModuleLoad (module.js:470:12)
wikijs_1          |     at Function.Module._load (module.js:462:3) errno: -21, code: 'EISDIR', syscall: 'read' }

Expected behavior

No error on start up using docker.

Steps to reproduce the behavior

  1. Create docker-compose.yml:
    
    wikijs:
    image: "requarks/wiki:latest"
    restart: always
    links:
    - wikijs-mongodb
    ports:
    - "8033:80"
    environment:
    - WIKI_ADMIN_EMAIL=XXXXX@gmail.com
    volumes:
    - /mnt/data/programs/wikijs/config.yml:/var/wiki/config.yml

wikijs-mongodb: image: mongo container_name: "mongodb" restart: always volumes:

  1. Execute docker-compose up

Searching for the error I found this stackoverflow article descriping that this error occurs when then code tries to open a file but the given path is a directory.

ChristianAEDev commented 7 years ago

I tried using the exact docker-compose.yml provided by you: https://github.com/Requarks/wiki/blob/master/tools/docker-compose.yml

The issue is the same.

(Side note: In the docker-compose.yml is a small mistake. The environment variable needs to be WIKI_ADMIN_EMAIL=admin@example.com)

NGPixel commented 7 years ago

Have you created the config.yml the "volumes" links to? This file must be created manually on your host and then linked to your docker container. If docker cannot link the file, it will appear as a directory inside the container, which causes the error.

NGPixel commented 7 years ago

@ChristianAEDev Both syntax are valid. However there was an extra - at the beginning which I removed.

ChristianAEDev commented 7 years ago

Awesome everything is working now. Thank your for your kind help and awesome software!

ChristianAEDev commented 7 years ago

I must be blind. Can you kindly tell me what the default administrator password is?

NGPixel commented 7 years ago

admin123

I'll improve the docs for docker shortly :wink:

ChristianAEDev commented 7 years ago

Works like a charm. This is the kind of wiki I have always been waiting for! Great work!