forked from k8sgateway/k8sgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (21 loc) · 802 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# First, pre-compile the search index so that
# the browser doesn't have to do it on page load.
FROM node:14.4.0-alpine3.10 as search-index-builder
ARG FROM_DIR
COPY search/ .
COPY $FROM_DIR/index.json .
RUN cat index.json | node generate-search-index.js > search-index.json
# Runtime image
FROM nginx:1.13.9-alpine
ARG VERSION
ARG PRODUCT_SCOPE
ARG FROM_DIR
# Replace existing NGINX configuration
RUN rm -rf /etc/nginx/conf.d
COPY conf /etc/nginx
# Copy over both regular and no_auth bundles
COPY $FROM_DIR /usr/share/nginx/html/no_auth/$PRODUCT_SCOPE/$VERSION
# Pull in the search index generated by the previous stage
COPY --from=search-index-builder search-index.json /usr/share/nginx/html/no_auth/$PRODUCT_SCOPE/$VERSION/search-index.json
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]