Allow port to be customized in dockerfile

This commit is contained in:
Martien Oranje 2021-01-06 09:37:45 +01:00 committed by GitHub
parent 5213146406
commit 3e91cd09bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,11 +38,14 @@ RUN ng build --output-path=dist
# base image
FROM nginx:1.16.0-alpine
# environmental variables
ENV PORT=80
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html
# expose port 80
EXPOSE 80
# expose port: defaults to 80
EXPOSE $PORT
# run nginx
CMD ["nginx", "-g", "daemon off;"]