How to run BlueOak server with automatic restart on file changing

Dockerfile

Create Dockerfile with following content

FROM ubuntu
RUN apt update
RUN apt install -y yum*
RUN yum-config-manager --enable *
RUN yum -y upgrade
RUN yum -y install epel-release
RUN yum -y install nodejs
RUN yum -y install npm
RUN yum -y install git
# Upgrade nodejs.
RUN yum -y install wget
# Install and load nvm.
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
# This loads nvm.
RUN export NVM_DIR="/root/.nvm" && chmod +x $NVM_DIR/nvm.sh && $NVM_DIR/nvm.sh
# Install BlueOak.
RUN git clone https://github.com/BlueOakJS/blueoak-server.git 
RUN cd blueoak-server; npm install -g blueoak-server
RUN cd blueoak-server/examples/swagger; npm install -g nodemon
RUN cd blueoak-server/examples/swagger; npm install lodash 
RUN cd blueoak-server/examples/swagger; npm install async 
RUN cd blueoak-server/examples/swagger; npm install semver 
RUN cd blueoak-server/examples/swagger; npm install debug 
RUN cd blueoak-server/examples/swagger; npm install strip-json-comments 
RUN cd blueoak-server/examples/swagger; npm install prompt 
RUN cd blueoak-server/examples/swagger; npm install import-fresh 
RUN cd blueoak-server/examples/swagger; npm install cfenv 
RUN cd blueoak-server/examples/swagger; npm install winston 
RUN cd blueoak-server/examples/swagger; npm install stack-trace 
RUN cd blueoak-server/examples/swagger; npm install express 
RUN cd blueoak-server/examples/swagger; npm install node-statsd 
RUN cd blueoak-server/examples/swagger; npm install on-headers 
RUN cd blueoak-server/examples/swagger; npm install redis 
RUN cd blueoak-server/examples/swagger; npm install swagger-parser 
RUN cd blueoak-server/examples/swagger; npm install tv4 
RUN cd blueoak-server/examples/swagger; npm install tv4-formats 
RUN cd blueoak-server/examples/swagger; npm install config 
RUN cd blueoak-server/examples/swagger; npm install body-parser 
RUN cd blueoak-server/examples/swagger; npm install cors 
RUN cd blueoak-server/examples/swagger; npm install express-static 
RUN cd blueoak-server/examples/swagger; npm install cookie-session 
RUN cd blueoak-server/examples/swagger; npm install verror 
RUN cd blueoak-server/examples/swagger; npm install multer 
RUN cd blueoak-server/examples/swagger; npm install request 
RUN cd blueoak-server/examples/swagger; npm install jsonwebtoken 
RUN cd blueoak-server/examples/swagger; npm install base64url 
RUN cd blueoak-server/examples/swagger; npm install rsa-pem-from-mod-exp 
RUN cd blueoak-server/examples/swagger; npm install raw-body 
RUN cd blueoak-server/examples/swagger; npm install node-cache
RUN echo "sh -c 'cd /blueoak-server/examples/swagger && nodemon'" >> /etc/rc.d/rc.local
RUN echo "exit 0" >> /etc/rc.d/rc.local
RUN chmod +x /etc/rc.d/rc.local

Building

Go to directory containing the file and execute

$ sudo docker build --tag swagger-blueoak .

How to set up automatically starting program in Docker-container

How to create Docker-container with BlueOak server

How to install swagger-generator

How to install docker CE

Dockerfile reference

BlueOak

Advertisements

How to create Docker-container with BlueOak server

Dockerfile

Create Dockerfile with following content

FROM centos:centos7
RUN yum -y upgrade
RUN yum -y install epel-release
RUN yum -y install nodejs
RUN yum -y install npm
# Upgrade nodejs.
RUN yum -y install wget
# Install and load nvm.
RUN wget -qO- https://raw.githubusercontent.com/creationix/
    nvm/v0.32.0/install.sh | bash
# This loads nvm.
RUN export NVM_DIR="/root/.nvm" && chmod +x 
    $NVM_DIR/nvm.sh && $NVM_DIR/nvm.sh
# Install BlueOak.
RUN npm install -g blueoak-server

Building

Go to directory containing the file and execute

$ sudo docker build --tag swagger-blueoak .

How to run BlueOak server

How to install docker CE

How to install swagger-generator

Dockerfile reference

BlueOak