add redis to docker-compose.yml

This commit is contained in:
Sam 2016-06-11 09:47:35 +02:00
parent 8720797744
commit a88390a7d1
2 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,7 @@ module.exports = function (app, db) {
var io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
var redis = require('socket.io-redis');
io.adapter(redis({ host: '127.0.0.1', port: 6379 }));
io.adapter(redis(process.env.REDIS_HOST || { host: '127.0.0.1', port: 6379 }));
// Add an event listener to the 'connection' event
io.on('connection', function (socket) {

View File

@ -7,6 +7,9 @@ services:
- "27017:27017"
volumes:
- mongo-data-wt:/data/db
redis:
image: redis
web:
build: .
volumes:
@ -17,8 +20,10 @@ services:
- "35729:35729"
links:
- db
- redis
environment:
DB_HOST: db
REDIS_HOST: redis
volumes:
mongo-data-wt:
driver: local