-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add docker to yeoman generator #200
Conversation
Yeah! 🤘 This is awesome! I need to get set up with a modern docker to try it out. @doug-wade - You're most familiar with this yeoman generator. Take a look at this! |
npm start | ||
``` | ||
|
||
Then go to [localhost:3000](http://localhost:3000/). You will see a simple page that pre-renders and that is interactive on load. It also will include hot reloading of React components in their own file. | ||
|
||
If you want to optimize the client code at the expense of startup time, type `NODE_ENV=production npm start`. You can also use any of [the other arguments for react-server-cli](../../react-server-cli#setting-options-manually) after `--`. For example: | ||
|
||
``` | ||
```shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Nice to have syntax coloring on these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for adding this!
"env": { | ||
"docker": { | ||
"host": "Your ip from `docker-machine ip` here" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool. Nice use of environment configuration.
Thanks for the added documentation. Clears it right up for me.
This looks great to me. 👍 I'd like to wait until @doug-wade has had a chance to look over it, too, since he knows this generator well. @doug-wade - Is this something that would be easy for us to prompt the user for down the road? Like |
"port": "80" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just occurred to me that we should probably generate this config. #203
Hey, I just tried this locally. The README changes showed up, but the dockerfile and the docker-compose.yml didn't... @doug-wade is there something else that needs to happen for new files to get picked up? |
@withinboredom This is pretty awesome! As @gigabo notes, there are still some things we'll want you to do before you merge
|
I added the docker files as a prompt, and included changes to the unit tests. I can't get the new test (where |
Also, it seems like a good idea to wait for #203 before generating the config for a dockerish runtime and I think its a good idea to leave that in the README for now. What do you think? |
Makes sense. |
I had issues with the config as well, I figured it was environmental ... guess I should open an issue. You can modify the script in package.json, here's mine for example: {
"name": "reactFrontend",
"version": "0.0.1",
"description": "A react-server instance",
"main": "HelloWorld.js",
"scripts": {
"start": "react-server-cli --host 192.168.99.100",
"test": "xo && nsp check"
},
"license": "Apache-2.0",
"dependencies": {
"babel-plugin-transform-runtime": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-runtime": "^6.6.1",
"react": "~0.14.2",
"react-dom": "~0.14.2",
"react-server": "^0.2.10",
"react-server-cli": "^0.2.10",
"superagent": "1.2.0"
},
"devDependencies": {
"eslint-config-xo-react": "^0.7.0",
"eslint-plugin-react": "^5.1.1",
"nsp": "^2.3.3",
"xo": "^0.15.1"
},
"xo": {
"esnext": true,
"extends": "xo-react",
"ignores": ["__clientTemp/**/*"]
}
} |
You can verify that the environment is set right by changing the hello world: Hello, World: {process.env.NODE_ENV} |
I think I found the bug ... trying a fix and PR if that was it. Not really setup to debug CLI scripts, so console.logging all over ;) |
Yep, fixed in #206 ... that was a fun one. |
Sweet, that worked. Thanks. Mind rebasing this branch to pick up your fix from #206 now that it's merged? I'll see if I can track down what's going wrong with the tests. |
@doug-wade - Uhh.... why aren't the tests passing here? Seems right. |
@withinboredom The bug was in the tests, not in your changes 🐑 . #207 should unblock you |
@withinboredom I think its failing with a (well-obscured) linter failure; I've added a line comment |
@@ -14,6 +14,11 @@ module.exports = yeoman.Base.extend({ | |||
name: 'name', | |||
message: 'What would you like to call your app?', | |||
default: this.appname | |||
},{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is causing the linter failure that's failing your build; it should be }, {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doug-wade - How did you track that down? I don't see anything about it in travis...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the branch locally to find #207 and when I verified that it made the existing tests pass, I noticed there was still a linter failure.
lgtm 👍 |
This is awesome! Thanks @withinboredom! I hope we'll see more cool stuff from you soon. 👹 |
BTW - I'm testing out a changelog generator. The next version's shaping up to be the @withinboredom show: Unreleased (2016-05-25)Bug fix
Enhancement
Commiters: 1 |
This PR adds a simple
docker-compose.yml
file and a simpleDockerfile
to the yeoman generator to allow people to quickly get up and running with Docker. This will be helpful for developers using Windows.