From a68b58888061584b532fe153b309270626a21e6c Mon Sep 17 00:00:00 2001 From: Matthias Luebken Date: Wed, 18 Jun 2014 15:59:24 +0200 Subject: [PATCH] first docker version with fig --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 11 +++++++++++ config/env/development.js | 4 +++- fig.yml | 10 ++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 fig.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..e45610cc96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# +# Note "> /dev/null" workaround for fig-bug https://github.com/orchardup/fig/issues/239 +# +FROM dockerfile/nodejs + +MAINTAINER Matthias Luebken, matthias@catalyst-zero.com + +WORKDIR /home/mean + +# Install Mean.JS Prerequisites +RUN npm install -g grunt-cli > /dev/null +RUN npm install -g bower > /dev/null + +# Install Mean.JS packages +ADD package.json /home/mean/package.json +RUN npm install > /dev/null + +# Make everything available for start +ADD . /home/mean + +# currently only works for development +ENV NODE_ENV development + +EXPOSE 3000 +CMD ["grunt"] \ No newline at end of file diff --git a/README.md b/README.md index 05ac4b3b0e..b8687e63c6 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,17 @@ Your application should run on the 3000 port so in your browser just go to [http That's it! your application should be running by now, to proceed with your development check the other sections in this documentation. If you encounter any problem try the Troubleshooting section. +## Development and deployment With Docker + +* Install [Docker](http://www.docker.com/) +* Install [Fig](https://github.com/orchardup/fig) + +* For local development and testing: +``` +$ fig up +``` + + ## Getting Started With MEAN.JS You have your application running but there are a lot of stuff to understand, we recommend you'll go over the [Offical Documentation](http://meanjs.org/docs.html). In the docs we'll try to explain both general concepts of MEAN components and give you some guidelines to help you improve your development procees. We tried covering as many aspects as possible, and will keep update it by your request, you can also help us develop the documentation better by checking out the *gh-pages* branch of this repository. diff --git a/config/env/development.js b/config/env/development.js index 17470972f2..8f1c18b73b 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -1,7 +1,9 @@ 'use strict'; +var DB_HOST = process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost'; + module.exports = { - db: 'mongodb://localhost/mean-dev', + db: 'mongodb://' + DB_HOST + '/mean-dev', app: { title: 'MEAN.JS - Development Environment' }, diff --git a/fig.yml b/fig.yml new file mode 100644 index 0000000000..08a4c26ce5 --- /dev/null +++ b/fig.yml @@ -0,0 +1,10 @@ +web: + build: . + links: + - db + ports: + - "3000:3000" +db: + image: mongo + ports: + - "27017:27017" \ No newline at end of file