-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (44 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
60 lines (44 loc) · 1.55 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM node:18.3.0 AS builder
ADD package*.json /opt/ui/
WORKDIR /opt/ui
RUN npm install
ADD src /opt/ui/src
ARG ui_path=/
ENV UI_PATH=${ui_path}
RUN npx parcel build src/index.html --public-url ${UI_PATH}
FROM nginx:alpine
LABEL org.opencontainers.image.description="Cross-cloud cost allocation models for Kubernetes workloads"
LABEL org.opencontainers.image.documentation=https://opencost.io/docs/
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source=https://github.com/opencost/opencost-ui
LABEL org.opencontainers.image.title=opencost-ui
LABEL org.opencontainers.image.url=https://opencost.io
ARG ui_path=/
ARG version=dev
ARG commit=HEAD
ENV VERSION=${version}
ENV HEAD=${commit}
ENV API_PORT=9003
ENV API_SERVER=0.0.0.0
ENV UI_PORT=9090
ENV UI_PATH=${ui_path}
# Nginx proxy timeout configuration (in seconds)
ENV PROXY_CONNECT_TIMEOUT=180
ENV PROXY_SEND_TIMEOUT=180
ENV PROXY_READ_TIMEOUT=180
COPY --from=builder /opt/ui/dist /opt/ui/dist
RUN mkdir -p /var/www
COPY THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
COPY --from=builder /opt/ui/dist /var/www
COPY default.nginx.conf.template /etc/nginx/conf.d/default.nginx.conf.template
COPY nginx.conf /etc/nginx/
COPY ./docker-entrypoint.sh /usr/local/bin/
RUN rm -rf /etc/nginx/conf.d/default.conf
RUN adduser 1001 -g 1000 -D
RUN chown 1001:1000 -R /var/www
RUN chown 1001:1000 -R /etc/nginx
RUN chown 1001:1000 -R /usr/local/bin/docker-entrypoint.sh
ENV BASE_URL=${UI_PATH%/}/model
USER 1001
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]