Amend Docker setup to work with create react app

pull/35/head
Will Piers 2016-09-14 15:42:36 -07:00
parent 848b324796
commit 66981ea5ce
2 changed files with 9 additions and 8 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
ui/node_modules
.git

View File

@ -1,18 +1,17 @@
FROM mhart/alpine-node:latest
ADD package.json /package.json
ADD webpack.config.js /webpack.config.js
WORKDIR /ui
ADD ui /ui
# Install node deps
RUN npm install
# Build assets to ./dist
RUN $(npm bin)/webpack
# Build assets to ./ui/build
RUN npm build
# Run the image as a non-root user
RUN adduser -D mrfusion
USER mrfusion
# Start the server. Currently this is just a webpack dev server
# in the future we'd start the go process here.
CMD $(npm bin)/webpack-dev-server --host 0.0.0.0 --port $PORT
# Start the server.
# in the future we'd start the go process here and serve the static assets in /build
CMD npm start