Repository navigation
Added Docker support for server only mode - #673
Conversation
| #### Manual | ||
|
|
||
| 1. Download and install the latest Node.js version. | ||
| 2. Clone the repository and check out the beta branch: `git clone https://github.com/MichMich/MagicMirror` |
There was a problem hiding this comment.
Should set master branch here not beta.
There was a problem hiding this comment.
What do you mean? Where did I use the "beta" branch?
There was a problem hiding this comment.
Yes, beta branch isn't use anymore. When you do it a checkout from url is used master branch. Just change the beta by master.
This is change done few days ago
a591cf1
There was a problem hiding this comment.
Oh now I see what you mean. Sorry. I just copied it from line 40. Should I change it there too?
| **Note:** if you want to debug on Raspberry Pi you can use `npm start dev` which will start the MagicMirror app with Dev Tools enabled. | ||
|
|
||
| ### Server Only | ||
| In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode. This will start the server, after which you can open the application in your browser of choice. |
There was a problem hiding this comment.
No remove reference to command node serveronly some users can be not understand how run the mode server only.
roramirez
left a comment
There was a problem hiding this comment.
I like it this change. After this can be take the next step mentioned on forum by @morozgrafix
There some little things are need to change.
|
@bastilimbach Please add your changes to the Thanks for your contribution! |
|
|
||
| var defaults = { | ||
| port: 8080, | ||
| port: process.env.MM_PORT || 8080, |
There was a problem hiding this comment.
@MichMich I did run grunt before and couldn't figure out what the problem was. jsLint says there are irregular whitespaces but there aren't any. Or am I completely wrong here?
There was a problem hiding this comment.
After MM_PORT there a stranger space. Irregular whitespace. In character 30. Add a normal space.
There was a problem hiding this comment.
Strange. But it worked. Thanks 👍
There was a problem hiding this comment.
Various whitespace characters can be inputted by programmers by mistake for example from copying or keyboard shortcuts. Pressing Alt + Space on OS X adds in a non breaking space character for example.
http://eslint.org/docs/rules/no-irregular-whitespace
|
Nice work! Thanks! |
|
@bastilimbach Looks like this change is causing black screen on load when starting MM with I believe that culprit is 354b745#diff-75953debd6cf3faf33d4ff10e8353645R11 More details https://forum.magicmirror.builders/post/13221 |
Any progress on this? Would be nice to get updated Docker images at Docker Hub |
|
@fewi For now you can just use the |
|
@fewi @MichMich Yeah, you can checkout the docker build -t magic_mirror .After building the image, run a container with this image by executing: docker run -d \
--publish 80:8080 \
--restart always \
--volume ~/magic_mirror/config:/opt/magic_mirror/config \
--volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
--name magic_mirror \
magic_mirrorYou might want to change the volume paths. |
|
Yesterday I was trying to build & run it on my windows machine. But it did not work. I made a PR to fix this #743 |
|
Hello everybody, |
I took a look at the last remaining FIXME comment in the code - the one in `js/app.js` pointing to PR #673. It's from 2017 and was already flagged as a hotfix back then. The problem: `MM_PORT` got written into a global `global.mmPort` that was then read inconsistently across the code - sometimes via the global, sometimes straight from `process.env`, plus separate logic in `defaults.js`. Three ways to get the same port. I pulled this into a single `getServerPort()` helper (`MM_PORT` -> `config.port` -> `8080`) and switched `app.js`, `defaults.js`, `server.js`, `electron.js` and both serveronly files over to it. The global is gone now. Basically the behavior should be unchanged.
I added a Dockerfile and some additional docker related files to support the deployment of the server only mode using Docker.
@MichMich to make the shell command work you need to create an account at Docker Hub and link this repository to it. So every time the Github Repo gets updated, the Docker Image will be rebuild and updated automatically.
Is it correct to add my changes under the "## [2.1.0] - 2016-12-31" section of the changelog?