From 05889990bb651ad009cbbe1fd28c312129d87b4e Mon Sep 17 00:00:00 2001 From: Eugenio Cunha Date: Thu, 1 Oct 2020 00:31:50 -0300 Subject: [PATCH 1/2] add Dockerfile multi-stage builds --- .dockerignore | 8 ++++++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8059b90 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.cache/ +.eslintignore +.eslintrc.js +.gitignore +Dockerfile +node_modules/ +public/ +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bde89ec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:12.18.4 as build + +WORKDIR /build + +COPY . ./ + +RUN npm install --production && npm run build + +FROM node:alpine + +WORKDIR /app + +COPY --from=build /build ./ + +EXPOSE 9000 + +CMD ["npm", "run", "serve"] \ No newline at end of file From 53a96ab28ef497a8c9b33a369a0fba78f47b837f Mon Sep 17 00:00:00 2001 From: Eugenio Cunha Date: Thu, 1 Oct 2020 00:40:17 -0300 Subject: [PATCH 2/2] change README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b3138a5..5f5bb85 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,14 @@ 4. ... 5. Profit! +### Docker instructions + +1. In the project directory, run `docker image build -t starship .` command. +2. Run `docker container run --name starship -d -p 8000:9000 starship` +3. Open `http://localhost:8000/`. +4. ... +5. Profit! + ## Deployment Push on the `master` branch.