Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Docker support for server only mode #673

Merged
merged 6 commits into from
Jan 31, 2017
Merged

Added Docker support for server only mode #673

merged 6 commits into from
Jan 31, 2017

Conversation

bastilimbach
Copy link
Contributor

@bastilimbach bastilimbach commented Jan 31, 2017

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?

  • Add the change to CHANGELOG.md

README.md Outdated
#### 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should set master branch here not beta.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? Where did I use the "beta" branch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh now I see what you mean. Sorry. I just copied it from line 40. Should I change it there too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

README.md Outdated
@@ -46,8 +46,41 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installer
**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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No remove reference to command node serveronly some users can be not understand how run the mode server only.

Copy link
Contributor

@roramirez roramirez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it this change. After this can be take the next step mentioned on forum by @morozgrafix

https://forum.magicmirror.builders/post/12602

There some little things are need to change.

@MichMich
Copy link
Collaborator

@bastilimbach Please add your changes to the [2.1.1] - Unreleased section of the CHANGELOG. Aso, the change doesn't seem to pass the travis test. Please run grunt to check what's wrong.

Thanks for your contribution!

js/defaults.js Outdated
@@ -8,7 +8,7 @@
*/

var defaults = {
port: 8080,
port: process.env.MM_PORT || 8080,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After MM_PORT there a stranger space. Irregular whitespace. In character 30. Add a normal space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. But it worked. Thanks 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@MichMich MichMich merged commit 049d249 into MagicMirrorOrg:develop Jan 31, 2017
@MichMich
Copy link
Collaborator

Nice work! Thanks!

@morozgrafix
Copy link
Contributor

@bastilimbach Looks like this change is causing black screen on load when starting MM with npm start or node serveronly and following error in the console log of chrome/electron.

Uncaught ReferenceError: process is not defined
    at defaults.js:11
(anonymous) @ defaults.js:11

I believe that culprit is 354b745#diff-75953debd6cf3faf33d4ff10e8353645R11

More details https://forum.magicmirror.builders/post/13221

roramirez added a commit to roramirez/MagicMirror that referenced this pull request Feb 1, 2017
roramirez added a commit to roramirez/MagicMirror that referenced this pull request Feb 1, 2017
MichMich added a commit that referenced this pull request Feb 1, 2017
@fewi
Copy link
Contributor

fewi commented Mar 2, 2017

@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.

Any progress on this? Would be nice to get updated Docker images at Docker Hub

@bastilimbach
Copy link
Contributor Author

@fewi Version 2.1.1 isn't released yet. Look at the Changelog. I think with the release of 2.1.1, @MichMich will put the image onto Docker Hub.

@MichMich
Copy link
Collaborator

MichMich commented Mar 2, 2017

@fewi For now you can just use the develop branch.

@bastilimbach
Copy link
Contributor Author

@fewi @MichMich Yeah, you can checkout the develop branch and build the image yourself by running:

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_mirror

You might want to change the volume paths.

@fewi
Copy link
Contributor

fewi commented Mar 3, 2017

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

@AnyKey8472
Copy link

Hello everybody,
I tried to get this docker image to run on my 6.1.1 Synology DS, but strugled with the installation steps. After downloading it via synology gui and (what I first thought was the installation) unpacking it, I don't know how to run the above mentioned code.
I'm new to docker in generell and a little bit overwhelmed, is there a readme, or tutorial, how to setup your docker container on a synology system?
Thanks
Andre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants