Giter Site home page Giter Site logo

docker-nodeclub's Introduction

本镜像由google/nodejs而来,代码根据 nodeclub 未使用redis的版本修改,mongo配置信息通过环境变量传递:

// Get db config from env
function _getMongoUrl(){
  var db_addr = process.env.MONGO_CARROT_ADDR;
  var db_port = process.env.MONGO_CARROT_PORT;
  var db_user = process.env.MONGO_CARROT_USER;
  var db_pass = process.env.MONGO_CARROT_PASS;
  var db_database =  process.env.MONGO_CARROT_DATABASE;
  var db_url  = 'mongodb://';
  if (db_user && db_pass) {
    db_url += (db_user + ':' + db_pass + '@');
  }
  db_url += (db_addr? db_addr: 'localhost');
  db_url += ':' + (db_port? db_port: 27017);
  db_url += '/' + (db_database? db_database: 'admin');
  console.log('Connect to MongoStore Use this url:' + db_url);
  return db_url;
}

网站实例: http://cnode-2967w.q1.tenxcloud.net:41894
其中数据库是使用时速云mongo镜像创建的。

注意使用本镜像创建容器时,要在高级设置中勾选更新镜像

以下是Nodeclub相关信息:

Nodeclub

build status Coverage Status David deps node version

介绍

Nodeclub 是使用 Node.jsMongoDB 开发的社区系统,界面优雅,功能丰富,小巧迅速, 已在Node.js 中文技术社区 CNode(http://cnodejs.org) 得到应用,但你完全可以用它搭建自己的社区。

安装部署

不保证 Windows 系统的兼容性

线上跑的是 Node.js v1.5,MongoDB 是 v2.6。

1. install `node.js[必须]` `mongodb[必须]`
2. run mongod
3. `$ make install` 安装 Nodeclub 的依赖包
4. `cp config.default.js config.js` 请根据需要修改配置文件
5. `$ make test` 确保各项服务都正常
6. `$ node app.js`
7. visit `localhost:3000`
8. done!

其他

跑测试

$ make test

跑覆盖率测试

$ make test-cov

License

MIT

docker-nodeclub's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-nodeclub's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.