From b6a8b754a84a9bb19c9bfd9d22536b9fa47ce960 Mon Sep 17 00:00:00 2001 From: Argan Wang Date: Fri, 11 Jan 2019 11:55:24 +0800 Subject: [PATCH] enhance the Dockerfile with default CMD to start --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 18c18f7..bac89f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ FROM node:10-alpine WORKDIR /opt/app - +COPY . /opt/app ENV PORT=80 +VOLUME /opt/app/server-data RUN touch /usr/bin/start.sh # this is the script which will run on start @@ -24,3 +25,5 @@ RUN echo 'npm install --production' >> /usr/bin/start.sh # npm start, make sure to have a start attribute in "scripts" in package.json RUN echo 'npm start' >> /usr/bin/start.sh + +CMD ["/bin/sh","/usr/bin/start.sh"]