From aab0462047a3fcd87ba258b5486aede922865b1e Mon Sep 17 00:00:00 2001 From: Mirko Da Corte Date: Tue, 25 May 2021 16:43:26 +0200 Subject: [PATCH] feat: added Dockerfile (#75) * feat: added Dockerfile (#72) * fix: applying requested fixes on Dockerfile * fix: updated exposed port on Dockerfile chore: updated readme with docker instructions * Update README.md Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com> * fix: fixed codeblock in readme Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com> --- Dockerfile | 12 ++++++++++++ README.md | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c5bd30a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:15.14-alpine AS build +WORKDIR /src +COPY . . +RUN npm ci +RUN npm run build + +FROM node:15.14-alpine AS final +RUN npm i -g serve +WORKDIR /app +COPY --from=build /src/build . +EXPOSE 8080 +ENTRYPOINT ["serve", "-l", "8080"] diff --git a/README.md b/README.md index 80aeaac..259385f 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,15 @@ npm run serve You can now access Bee Dashboard on [http://localhost:8080/](http://localhost:8080/) +## Docker + +To build Docker image and run it, execute the following from inside project directory: + +```sh +docker build . -t bee-dashboard +docker run --rm -p 127.0.0.1:8080:8080 bee-dashboard +``` + ## Contribute There are some ways you can make this module better: