-
-
Save bcopy/f5c7961a3d07cc119b83147586100e71 to your computer and use it in GitHub Desktop.
Docker example to build Cyclotron
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build and run | |
docker build --no-cache -rm -t scr512/cyclotron /opt/docker/docker-cyclotron | |
docker run -d --restart=always --name cyclotron -v /work/cyclotron/data:/data -p 8080:8080 -p 8077:8077 scr512/cyclotron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec /usr/bin/supervisord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cyclotronServices.factory('configService', ['commonConfigService', function(commonConfigService) { | |
var cyclotronEnvironments, exports, merged, proxyOptions; | |
cyclotronEnvironments = [ | |
{ | |
name: 'Dev', | |
serviceUrl: 'http://cyclotron/api', | |
requiresAuth: true, | |
canPush: true | |
}, { | |
name: 'Localhost', | |
serviceUrl: 'http://127.0.0.1:8077', | |
requiresAuth: false, | |
canPush: false | |
} | |
]; | |
proxyOptions = _.reduce(cyclotronEnvironments, function(options, environment) { | |
options[environment.name] = { | |
value: environment.serviceUrl | |
}; | |
return options; | |
}, {}); | |
exports = { | |
restServiceUrl: 'http://127.0.0.1:8077', | |
authentication: { | |
enable: false, | |
loginMessage: 'Please login using your LDAP username and password.' | |
}, | |
enableAnalytics: true, | |
cyclotronEnvironments: cyclotronEnvironments, | |
dashboard: { | |
properties: { | |
dataSources: { | |
options: { | |
graphite: { | |
properties: { | |
url: { | |
"default": 'http://graphite' | |
}, | |
proxy: { | |
options: proxyOptions | |
} | |
} | |
}, | |
json: { | |
properties: { | |
proxy: { | |
options: proxyOptions | |
} | |
} | |
}, | |
splunk: { | |
properties: { | |
host: { | |
"default": 'splunk' | |
}, | |
proxy: { | |
options: proxyOptions | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}; | |
merged = _.merge(commonConfigService, exports, _["default"]); | |
merged.help[0].messages = [ | |
{ | |
type: 'info', | |
html: 'Welcome to Cyclotron!', | |
icon: 'fa-info-circle' | |
} | |
]; | |
return merged; | |
}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Dockerfile | |
FROM phusion/baseimage:latest | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
RUN apt-get update | |
RUN apt-get install -y build-essential git mongodb-org supervisor curl wget nginx | |
RUN curl -sL https://deb.nodesource.com/setup | sudo bash - | |
RUN apt-get install -y nodejs | |
RUN npm install -g npm@latest | |
RUN npm install -g gulp phantomjs casperjs bower | |
RUN mkdir -p /data/db | |
RUN mkdir -p /opt/app | |
WORKDIR /opt/app | |
RUN git clone https://github.com/ExpediaInceCommercePlatform/cyclotron.git /opt/app | |
RUN cd /opt/app/cyclotron-svc && npm install | |
RUN cd /opt/app/cyclotron-site && npm install | |
RUN cp /opt/app/cyclotron-svc/config/sample.config.js /opt/app/cyclotron-svc/config/config.js | |
ADD ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
ADD ./boot.sh /usr/bin/boot.sh | |
ADD ./configService.js /opt/app/cyclotron-site/_public/js/conf/configService.js | |
RUN mkdir -p /var/log/supervisor | |
VOLUME ["/data"] | |
EXPOSE 8077 | |
EXPOSE 8080 | |
CMD ["/usr/bin/boot.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[supervisord] | |
nodaemon = true | |
[program:mongodb] | |
command = /usr/bin/mongod | |
stdout_logfile = /var/log/supervisor/%(program_name)s.log | |
stderr_logfile = /var/log/supervisor/%(program_name)s.log | |
autorestart = true | |
[program:cyclotron-svc] | |
directory = /opt/app/cyclotron-svc | |
command = /usr/bin/node /opt/app/cyclotron-svc/app.js | |
stdout_logfile = /var/log/supervisor/%(program_name)s.log | |
stderr_logfile = /var/log/supervisor/%(program_name)s.log | |
autorestart = true | |
[program:cyclotron-site] | |
directory = /opt/app/cyclotron-site | |
command = /usr/bin/gulp server | |
stdout_logfile = /var/log/supervisor/%(program_name)s.log | |
stderr_logfile = /var/log/supervisor/%(program_name)s.log | |
autorestart = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment