Skip to content
Snippets Groups Projects

nginx will now serve our UI instead of the ng development server

Merged Andrew Kapuscinski requested to merge WS-105-serve-ui-with-nginx into main
2 files
+ 42
2
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 25
2
FROM marconi.aoc.nrao.edu/ops/base:nodejs-14
FROM marconi.aoc.nrao.edu/ops/base:nodejs-14 as base-build
# TODO: install chrome dependencies for e2e test here
WORKDIR /app
@@ -12,4 +14,25 @@ RUN npm install \
COPY ./apps/web ./
CMD [ "npm", "start" ]
\ No newline at end of file
# TODO: Run e2e tests here
# Build the angular app
RUN ./node_modules/.bin/ng build --prod --output-path=dist
# Use nginx base image
FROM nginx:1.19.7-alpine
# Copy WS nginx config from base-build stage
COPY --from=base-build /app/ws-nginx.conf /etc/nginx/conf.d/
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy Angular build from base-build stage
COPY --from=base-build /app/dist /usr/share/nginx/html
# Expose port
EXPOSE 4444
# Run nginx with daemon off to run as foreground process
CMD nginx -g "daemon off;"
\ No newline at end of file
Loading