Created
January 8, 2022 15:42
-
-
Save smaillns/557ce25dd8797d468bd5d130c5badc77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build the app | |
FROM node:12-alpine as build | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm install -g @angular/cli | |
RUN ng build --prod --output-path=/dist | |
# Run in NGINX | |
FROM nginx:alpine | |
COPY --from=build /dist /usr/share/nginx/html | |
# When the container starts, replace the env.js with values from environment variables | |
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment