From 66981ea5ce5f8c460b6127b2f60bf119a0568581 Mon Sep 17 00:00:00 2001 From: Will Piers Date: Wed, 14 Sep 2016 15:42:36 -0700 Subject: [PATCH] Amend Docker setup to work with create react app --- .dockerignore | 2 ++ Dockerfile | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..f4eceb4d1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +ui/node_modules +.git diff --git a/Dockerfile b/Dockerfile index 7c16aab22..902e48b60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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