update ports and variables for docker compose bootstrap
This commit is contained in:
parent
a3e2129b79
commit
f9cf8ba7e8
4
app.js
4
app.js
@ -121,11 +121,11 @@ if (app.get('env') == 'development') {
|
|||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
||||||
// CONNECT TO DATABASE
|
// CONNECT TO DATABASE
|
||||||
const mongoHost = process.env.MONGO_PORT_27017_TCP_ADDR || 'localhost';
|
const mongoHost = process.env.MONGO_PORT_27017_TCP_ADDR || 'db';
|
||||||
mongoose.connect('mongodb://' + mongoHost + '/spacedeck');
|
mongoose.connect('mongodb://' + mongoHost + '/spacedeck');
|
||||||
|
|
||||||
// START WEBSERVER
|
// START WEBSERVER
|
||||||
const port = 9000;
|
const port = 9666;
|
||||||
|
|
||||||
const server = http.Server(app).listen(port, () => {
|
const server = http.Server(app).listen(port, () => {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"endpoint": "http://localhost:9000",
|
"endpoint": "http://localhost:9666",
|
||||||
"storage_bucket": "my_spacedeck_s3_bucket",
|
"storage_bucket": "my_spacedeck_s3_bucket",
|
||||||
"storage_cdn": "xyz.cloudfront.net",
|
"storage_cdn": "http://localhost:9666",
|
||||||
"google_access" : "",
|
"google_access" : "",
|
||||||
"google_secret" : "",
|
"google_secret" : "",
|
||||||
"admin_pass": "very_secret_admin_password",
|
"admin_pass": "very_secret_admin_password",
|
||||||
|
@ -32,6 +32,9 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
phantom.create({ path: require('phantomjs-prebuilt').path }, function (err, browser) {
|
phantom.create({ path: require('phantomjs-prebuilt').path }, function (err, browser) {
|
||||||
|
if(err){
|
||||||
|
console.err(err);
|
||||||
|
}else{
|
||||||
return browser.createPage(function (err, page) {
|
return browser.createPage(function (err, page) {
|
||||||
console.log("page created, opening ",space_url);
|
console.log("page created, opening ",space_url);
|
||||||
|
|
||||||
@ -57,6 +60,8 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
onExit: on_exit
|
onExit: on_exit
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ const websockets = require('./websockets');
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
connectRedis(){
|
connectRedis(){
|
||||||
const redisHost = process.env.REDIS_PORT_6379_TCP_ADDR || 'localhost';
|
const redisHost = process.env.REDIS_PORT_6379_TCP_ADDR || 'sync';
|
||||||
this.connection = new RedisConnection(6379, redisHost);
|
this.connection = new RedisConnection(6379, redisHost);
|
||||||
},
|
},
|
||||||
sendMessage(action, model, attributes, channelId) {
|
sendMessage(action, model, attributes, channelId) {
|
||||||
|
@ -6,6 +6,15 @@ AWS.config.region = 'eu-central-1';
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var config = require('config');
|
var config = require('config');
|
||||||
|
|
||||||
|
var cdn = config.get("storage_cdn")
|
||||||
|
var storage_endpoint = 'http://storage:9000';
|
||||||
|
const bucketName = "sdeck-fresh-development";
|
||||||
|
const ep = new AWS.Endpoint(storage_endpoint);
|
||||||
|
const s3 = new AWS.S3({
|
||||||
|
endpoint: ep
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
removeFile: (path, callback) => {
|
removeFile: (path, callback) => {
|
||||||
const s3 = new AWS.S3({
|
const s3 = new AWS.S3({
|
||||||
|
@ -3,7 +3,7 @@ require('../models/schema');
|
|||||||
|
|
||||||
const WebSocketServer = require('ws').Server;
|
const WebSocketServer = require('ws').Server;
|
||||||
|
|
||||||
const Redis = require('ioredis');
|
const RedisConnection = require('ioredis');
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const _ = require("underscore");
|
const _ = require("underscore");
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
@ -12,7 +12,7 @@ const crypto = require('crypto');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
startWebsockets: function(server){
|
startWebsockets: function(server){
|
||||||
this.setupSubscription();
|
this.setupSubscription();
|
||||||
this.state = new Redis(6379, process.env.REDIS_PORT_6379_TCP_ADDR || 'localhost');
|
this.state = new RedisConnection(6379, process.env.REDIS_PORT_6379_TCP_ADDR || 'sync');
|
||||||
|
|
||||||
if(!this.current_websockets){
|
if(!this.current_websockets){
|
||||||
this.current_websockets = [];
|
this.current_websockets = [];
|
||||||
@ -117,7 +117,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setupSubscription: function() {
|
setupSubscription: function() {
|
||||||
this.cursorSubscriber = new Redis(6379, process.env.REDIS_PORT_6379_TCP_ADDR || 'localhost');
|
this.cursorSubscriber = new RedisConnection(6379, process.env.REDIS_PORT_6379_TCP_ADDR || 'sync');
|
||||||
this.cursorSubscriber.subscribe(['cursors', 'users', 'updates'], function (err, count) {
|
this.cursorSubscriber.subscribe(['cursors', 'users', 'updates'], function (err, count) {
|
||||||
console.log("[redis] websockets to " + count + " topics." );
|
console.log("[redis] websockets to " + count + " topics." );
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,7 @@ module.exports.teamSchema.index({
|
|||||||
|
|
||||||
module.exports.teamSchema.statics.getTeamForHost = (host, cb) => {
|
module.exports.teamSchema.statics.getTeamForHost = (host, cb) => {
|
||||||
|
|
||||||
if (host != "127.0.0.1:9000") { //phantomjs check
|
if (host != "127.0.0.1:9666") { //phantomjs check
|
||||||
let subDomainParts = host.split('.');
|
let subDomainParts = host.split('.');
|
||||||
|
|
||||||
if (subDomainParts.length > 2) {
|
if (subDomainParts.length > 2) {
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
{% if process.env.NODE_ENV != "production" %}
|
{% if process.env.NODE_ENV != "production" %}
|
||||||
var ENV = {
|
var ENV = {
|
||||||
name: 'development',
|
name: 'development',
|
||||||
webHost: "localhost:9000",
|
webHost: "localhost:9666",
|
||||||
webEndpoint:"http://localhost:9000",
|
webEndpoint:"http://localhost:9666",
|
||||||
apiEndpoint: "http://localhost:9000",
|
apiEndpoint: "http://localhost:9666",
|
||||||
websocketsEndpoint: "ws://localhost:9000"
|
websocketsEndpoint: "ws://localhost:9666"
|
||||||
};
|
};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user