Skip to content
Snippets Groups Projects
Commit 0f77e5ea authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

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

parent e001e69a
No related branches found
No related tags found
1 merge request!104nginx will now serve our UI instead of the ng development server
Pipeline #737 passed
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 WORKDIR /app
...@@ -12,4 +14,25 @@ RUN npm install \ ...@@ -12,4 +14,25 @@ RUN npm install \
COPY ./apps/web ./ COPY ./apps/web ./
CMD [ "npm", "start" ] # TODO: Run e2e tests here
\ No newline at end of file
# 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
# Workspaces NGINX config
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment