-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(gen) add Dockerfile and docker-compose.yml support #938
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Production Dockerfile - Used in the dist directory after grunt build | ||
FROM node:0.12-onbuild | ||
ENV NODE_ENV production | ||
EXPOSE 8080 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file works in the dist directory after grunt build is finished. | ||
# Usage: | ||
# pip install docker-compose | ||
# docker-compose up | ||
<% if (filters.mongoose) { %> | ||
<%= _.slugify(appname) %>mongodb: | ||
image: mongo:latest<% } %> | ||
<%= _.slugify(appname) %>: | ||
build: . | ||
links: | ||
- "<%= _.slugify(appname) %>mongodb:mongodb" | ||
ports: | ||
- "8080:8080" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,11 @@ module.exports = { | |
uri: process.env.MONGOLAB_URI || | ||
process.env.MONGOHQ_URL || | ||
process.env.OPENSHIFT_MONGODB_DB_URL + | ||
process.env.OPENSHIFT_APP_NAME || | ||
process.env.OPENSHIFT_APP_NAME ||<% if (filters.docker) { %> | ||
(process.env.MONGODB_PORT_27017_TCP_ADDR ? 'mongodb://' + | ||
process.env.MONGODB_PORT_27017_TCP_ADDR + ':' + | ||
process.env.MONGODB_PORT_27017_TCP_PORT + | ||
'/<%= _.slugify(appname) %>' : null) ||<% } %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's all this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is code to make the docker node container see the mongo container https://www.thachmai.info/2015/05/10/docker-container-linking-mongo-node/ |
||
'mongodb://localhost/<%= _.slugify(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.
We shouldn't be using Node < 4