Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

mapping config #4

Closed
Seb788 opened this issue May 7, 2019 · 4 comments
Closed

mapping config #4

Seb788 opened this issue May 7, 2019 · 4 comments

Comments

@Seb788
Copy link

Seb788 commented May 7, 2019

Hi,
im trying to map the config file to /app/config.json in docker.
it doesn't work for me.
i always get " invalid configuration file...using default configuration.

I use this command.
docker container run -it --rm p 3000:3000 -v $PWD/config.json:app mapclient

Could you write an example for the proper way to map this file?
Thank you

@Hypfer
Copy link
Owner

Hypfer commented May 7, 2019

This is how my docker-compose file looks like

    icantbelieveitsnotvaletudo:
        build:
          context: ./ICantBelieveItsNotValetudo/
          dockerfile: Dockerfile
        container_name: "ICantBelieveItsNotValetudo"
        restart: always
        volumes:
            - /opt/dockerized/ICantBelieveItsNotValetudo/config.json:/app/config.json

@Seb788
Copy link
Author

Seb788 commented May 8, 2019

Hi Hypfer,
It is still not working,

I created a file on the host named config.json with my mqtt info in it.
/root/Documents/mapclient/IcantBelieveItsNotValetudo/config.json

then I created a simple docker file like this

`    icantbelieveitsnotvaletudo:
        build: .
        container_name: "ICantBelieveItsNotValetudo"
        volumes:
            - /root/Documents/mapclient/IcantBelieveItsNotValetudo/config.json:/app/config.json`

The image gets build and the container starts
but I always get this error,

`root@debian-ha:~/Documents/mapclient/ICantBelieveItsNotValetudo# docker-compose up
Starting ICantBelieveItsNotValetudo ... done
Attaching to ICantBelieveItsNotValetudo
ICantBelieveItsNotValetudo    | 
ICantBelieveItsNotValetudo    | > i-cant-believe-its-not-valetudo@0.2.0 start /app
ICantBelieveItsNotValetudo    | > node app.js
ICantBelieveItsNotValetudo    | 
ICantBelieveItsNotValetudo    | Loading configuration file: /app/config.json
ICantBelieveItsNotValetudo    | Invalid configuration file!
ICantBelieveItsNotValetudo    | Writing new file using defaults
ICantBelieveItsNotValetudo    | fs.js:646
ICantBelieveItsNotValetudo    |   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
ICantBelieveItsNotValetudo    |                  ^
ICantBelieveItsNotValetudo    | 
ICantBelieveItsNotValetudo    | Error: EISDIR: illegal operation on a directory, open '/app/config.json'
ICantBelieveItsNotValetudo    |     at Object.fs.openSync (fs.js:646:18)
ICantBelieveItsNotValetudo    |     at Object.fs.writeFileSync (fs.js:1299:33)
ICantBelieveItsNotValetudo    |     at Configuration.persist (/app/lib/Configuration.js:80:8)
ICantBelieveItsNotValetudo    |     at new Configuration (/app/lib/Configuration.js:45:18)
ICantBelieveItsNotValetudo    |     at Object.<anonymous> (/app/app.js:6:14)
ICantBelieveItsNotValetudo    |     at Module._compile (module.js:653:30)
ICantBelieveItsNotValetudo    |     at Object.Module._extensions..js (module.js:664:10)
ICantBelieveItsNotValetudo    |     at Module.load (module.js:566:32)
ICantBelieveItsNotValetudo    |     at tryModuleLoad (module.js:506:12)
ICantBelieveItsNotValetudo    |     at Function.Module._load (module.js:498:3)
ICantBelieveItsNotValetudo    | npm ERR! code ELIFECYCLE
ICantBelieveItsNotValetudo    | npm ERR! errno 1
ICantBelieveItsNotValetudo    | npm ERR! i-cant-believe-its-not-valetudo@0.2.0 start: `node app.js`
ICantBelieveItsNotValetudo    | npm ERR! Exit status 1
ICantBelieveItsNotValetudo    | npm ERR! 
ICantBelieveItsNotValetudo    | npm ERR! Failed at the i-cant-believe-its-not-valetudo@0.2.0 start script.
ICantBelieveItsNotValetudo    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
ICantBelieveItsNotValetudo    | 
ICantBelieveItsNotValetudo    | npm ERR! A complete log of this run can be found in:
ICantBelieveItsNotValetudo    | npm ERR!     /root/.npm/_logs/2019-05-08T02_33_29_067Z-debug.log
ICantBelieveItsNotValetudo exited with code 1
`

Thanks for your help.

@Hypfer
Copy link
Owner

Hypfer commented May 8, 2019

/root/Documents/mapclient/IcantBelieveItsNotValetudo/config.json is most likely a directory

@Seb788
Copy link
Author

Seb788 commented May 10, 2019

Thanks, it works now.

@Hypfer Hypfer closed this as completed May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants