define port in environment variable
This commit is contained in:
parent
dd183a3b42
commit
04525df9fa
@ -1,3 +1,5 @@
|
|||||||
|
ARG PORT=3000
|
||||||
|
ENV PORT=$PORT
|
||||||
# Use the official lightweight Node.js 12 image.
|
# Use the official lightweight Node.js 12 image.
|
||||||
# https://hub.docker.com/_/node
|
# https://hub.docker.com/_/node
|
||||||
FROM node:12-alpine
|
FROM node:12-alpine
|
||||||
@ -11,6 +13,6 @@ COPY / ./
|
|||||||
RUN npm install
|
RUN npm install
|
||||||
# Compile to production
|
# Compile to production
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
EXPOSE 3000
|
EXPOSE ${PORT}
|
||||||
# Run the web service on container startup.
|
# Run the web service on container startup.
|
||||||
CMD [ "npm", "start" ]
|
CMD [ "npm", "start" ]
|
Loading…
Reference in New Issue
Block a user