From 2c874519b859c9fff67d4ad22e372eb6835bd91e Mon Sep 17 00:00:00 2001 From: ryanaltair_quicklane Date: Fri, 30 Aug 2019 13:38:38 +0800 Subject: [PATCH] add docker --- docker.md | 14 ++++++++++++++ docker/Dockerfile | 4 ++++ docker/build.sh | 1 + docker/run.sh | 1 + 4 files changed, 20 insertions(+) create mode 100644 docker.md create mode 100644 docker/Dockerfile create mode 100644 docker/build.sh create mode 100644 docker/run.sh diff --git a/docker.md b/docker.md new file mode 100644 index 0000000..5178455 --- /dev/null +++ b/docker.md @@ -0,0 +1,14 @@ +## how to run as docker + +build image +``` +bash docker/build.sh +``` + +now run +``` +bash docker/run.sh +``` + + +visit http://localhost:9250 and enjoy \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..49dcb0a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,4 @@ +From node:8.16.1-alpine +WORKDIR /home/server +ADD . . +RUN npm install --no-save \ No newline at end of file diff --git a/docker/build.sh b/docker/build.sh new file mode 100644 index 0000000..235b40f --- /dev/null +++ b/docker/build.sh @@ -0,0 +1 @@ +docker build -f docker/Dockerfile -t mstscjs:0.2.4 . \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh new file mode 100644 index 0000000..4ac3af2 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1 @@ +docker run -p 9250:9250 mstscjs:0.1.0 node server.js \ No newline at end of file