From 2395af36d97300d40506d9e0291dcdd3170e6998 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Mon, 24 Dec 2018 14:01:05 +0100 Subject: [PATCH] Update Dockerfile to run the server --- Dockerfile | 23 +++++++++++++++++++++-- package.json | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 576b054..48b2e91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,21 @@ -FROM nginx -COPY dist /usr/share/nginx/html +FROM node:10-alpine + +# Reduce npm install verbosity, overflows Travis CI log view +ENV NPM_CONFIG_LOGLEVEL warn +ENV NODE_ENV production + +EXPOSE 8080 + +RUN mkdir -p /var/infoscreens +WORKDIR /var/infoscreens +COPY package.json /var/infoscreens +COPY server /var/infoscreens/server +COPY dist /var/infoscreens/dist + +# Install NoFlo and dependencies +RUN npm install --only=production + +# Map the volumes +VOLUME /var/infoscreens/dist + +CMD npm start diff --git a/package.json b/package.json index 5c200cb..63b0d8d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "webpack", "pretest": "eslint index.js lib/*.js elements/*.js infodisplay/*.js events/*.js", - "start": "webpack-dev-server", + "dev": "webpack-dev-server", + "start": "node server", "test": "npm run build" }, "author": "Henri Bergius ",