Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 910 Bytes

README.md

File metadata and controls

63 lines (43 loc) · 910 Bytes

ringojs-docker

ringojs-docker images

dockerfile

build with deb package


FROM java:8
MAINTAINER  1141591465@qq.com
RUN apt-get update && apt-get install -y jsvc
ADD ringojs_1.2.1_all.deb /tmp/ringojs.deb
RUN dpkg -i /tmp/ringojs.deb && rm /tmp/ringojs.deb
CMD         ["bash"]

How to use

FROM dalongrong/ringojs-docker
WORKDIR /app
COPY app.js  /app/
ENTRYPOINT [ "ringo","app.js" ]

app.js

var app = function(request) {
   return {
      body: ['Hello World'],
      headers: {'Content-Type': 'text/html'},
      status: 200
   }
}

var {Server} = require('ringo/httpserver');
var server = new Server({app: app, port: 8080,host:"0.0.0.0"});
server.start();

How to Build

  • base image

docker-compose -f docker-compose -f docker-compose-base.yaml

How to Run demo

docker-compose up -d

Access

open http://localhost:8080