Commit def953f8 authored by Andres Toomsalu's avatar Andres Toomsalu
Browse files

Switching to apache-php demoapp version

parent e8f6b04a
......@@ -5,20 +5,15 @@ MAINTAINER OpenNode LLC <info@opennodecloud.com>
RUN yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# install pre-requisites
RUN yum install -y npm net-tools
RUN yum install -y httpd php php-mysql net-tools
RUN mkdir -p /var/www/html
# add health check script
ADD nf-demo-app-check /usr/bin/nf-demo-app-check
# make the nodejs src folder available in the docker image
ADD nodejs/ /srv/nodejs
WORKDIR /srv/nodejs
# install the dependencies from the package.json file
RUN npm install
# make port 80 available outside of the image
EXPOSE 80
# start node with the index.js file of our hello-world application
CMD ["node", "index.js"]
ENTRYPOINT ["/usr/sbin/httpd"]
CMD ["-D", "FOREGROUND"]
......@@ -16,7 +16,7 @@ docker run --name=$DEMOAPP_INSTANCE -h $HOSTNAME \
-p $DEMOAPP_BIND_ADDR:8010:80 \
-e SERVICE_80_CHECK_CMD=/usr/bin/nf-demo-app-check \
-e DEMOAPP_HELLOWORLD=\"$DEMOAPP_HELLOWORLD\" \
-v $DEMOAPP_DATADIR:/var/lib/nf-demo-app \
-v $DEMOAPP_DATADIR:/var/www/html \
$DEMOAPP_IMAGE"
ExecStop=-/usr/bin/docker stop $DEMOAPP_INSTANCE
......
var express = require('express');
var os = require("os");
var app = express();
var hostname = os.hostname();
app.get('/', function (req, res) {
res.send('<html><body>Hello from Node.js container ' + hostname + '</body></html>');
});
app.listen(80);
console.log('Running on http://localhost');
{
"name": "nodefabric-hello-world",
"private": true,
"version": "0.0.1",
"description": "Node.js Hello world app on NodeFabric",
"author": "opennodecloud.com",
"dependencies": {
"express": "4.12.0"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment