diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4f92a50 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:8-alpine as frontend_builder +WORKDIR /wallet +RUN apk add --no-cache make +ADD . /wallet +RUN npm install -g @angular/cli && npm rebuild node-sass && npm i && rm -rf dist/wallet && ng build --aot + + +FROM nginx:alpine + +# copy artifact build from the 'build environment' +COPY --from=frontend_builder /wallet/dist /usr/share/nginx/html + +# expose port 80 +EXPOSE 80 + +# run nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/README.md b/README.md index 3495fe5..b224df9 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,11 @@ make run ## Development server Run `make run` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + + +## Creating a docker container to run locally + +```sh +docker build -t wallet . +docker run -p 80:80 wallet +```