I want to read the PORT
variable inside Dockerfile which is defined in .env
file.
Is there any way to do this?
这是我的Dockerfile:
FROM node:11-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV PORT=3000
COPY . .
RUN npm install
EXPOSE 3000
CMD ["npm", "run", "start"]
you can use the ARG in your Dockerfile which is meant for this purpose.