Merge branch 'pr/101' into 0.3.2

This commit is contained in:
Amos Haviv
2014-07-19 14:04:43 +03:00
6 changed files with 73 additions and 3 deletions

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
FROM dockerfile/nodejs
MAINTAINER Matthias Luebken, matthias@catalyst-zero.com
WORKDIR /home/mean
# Install Mean.JS Prerequisites
RUN npm install -g grunt-cli
RUN npm install -g bower
# Install Mean.JS packages
ADD package.json /home/mean/package.json
RUN npm install
# Manually trigger bower. Why doesnt this work via npm install?
ADD .bowerrc /home/mean/.bowerrc
ADD bower.json /home/mean/bower.json
RUN bower install --config.interactive=false --allow-root
# Make everything available for start
ADD . /home/mean
# currently only works for development
ENV NODE_ENV development
# Port 3000 for server
# Port 35729 for livereload
EXPOSE 3000 35729
CMD ["grunt"]

View File

@@ -77,6 +77,29 @@ 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)
* Local development and testing with fig:
```bash
$ fig up
```
* Local development and testing with just Docker:
```bash
$ docker build -t mean .
$ docker run -p 27017:27017 -d --name db mongo
$ docker run -p 3000:3000 --link db:db_1 mean
$
```
* To enable live reload forward 35729 port and mount /app and /public as volumes:
```bash
$ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean/public:/home/mean/public -v /Users/mdl/workspa/mean-stack/mean/app:/home/mean/app --link db:db_1 mean
```
## 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.

View File

@@ -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'
},

View File

@@ -1,7 +1,9 @@
'use strict';
var DB_HOST = process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost';
module.exports = {
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://localhost/mean',
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + DB_HOST + '/mean',
assets: {
lib: {
css: [

4
config/env/test.js vendored
View File

@@ -1,7 +1,9 @@
'use strict';
var DB_HOST = process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost';
module.exports = {
db: 'mongodb://localhost/mean-test',
db: 'mongodb://' + DB_HOST + '/mean-test',
port: 3001,
app: {
title: 'MEAN.JS - Test Environment'

12
fig.yml Normal file
View File

@@ -0,0 +1,12 @@
web:
build: .
links:
- db
ports:
- "3000:3000"
environment:
NODE_ENV: development
db:
image: mongo
ports:
- "27017:27017"