From 04525df9fa267d7daf2a43eefd0fba2280a3bf00 Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Sun, 17 Jan 2021 20:29:27 +0100 Subject: [PATCH] define port in environment variable --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2806337..879cff1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +ARG PORT=3000 +ENV PORT=$PORT # Use the official lightweight Node.js 12 image. # https://hub.docker.com/_/node FROM node:12-alpine @@ -11,6 +13,6 @@ COPY / ./ RUN npm install # Compile to production RUN npm run build -EXPOSE 3000 +EXPOSE ${PORT} # Run the web service on container startup. CMD [ "npm", "start" ] \ No newline at end of file