Skip to content

Instantly share code, notes, and snippets.

@adam-hert
Created December 2, 2016 22:31
Show Gist options
  • Save adam-hert/1c2cce3e48803de9591ea511444fe050 to your computer and use it in GitHub Desktop.
Save adam-hert/1c2cce3e48803de9591ea511444fe050 to your computer and use it in GitHub Desktop.
FROM ubuntu
MAINTAINER Adam Hert
RUN apt-get update && sudo apt-get install -y nodejs && \
apt-get install -y nodejs-legacy && \
apt-get install -y wget && \
wget https://files.appneta.com/install_appneta.sh && \
sh ./install_appneta.sh <site key> && \
mkdir /var/node && \
apt-get install -y npm && \
npm install --save -y --prefix /var/node traceview
ADD server.js /var/node/server.js
ADD ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]
CMD ["nodejs", "/var/node/server.js"]
var tv = require('traceview');
tv.traceMode = 'always';
//set tv agent to send trace data to host IP instead of localhost
//tv.host = '192.168.0.246';
// Load the http module to create an http server.
var http = require('http');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);
// Put a friendly message on the terminal
console.log("Server running at http://127.0.0.1:8000/");
[supervisord]
nodaemon=true
[program:tracelyzer]
command=/etc/init.d/tracelyzer start -D
[program:node]
command=/usr/bin/node /var/node/server.js -DFOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment