11FROM node:20-alpine AS builder
22
3- WORKDIR /app
3+ RUN apk add --no-cache git
44
5- COPY package.json yarn.lock .
5+ WORKDIR /app
6+ COPY package.json .
7+ COPY yarn.lock .
68
7- RUN apk add --no-cache git
89RUN yarn install --frozen-lockfile --network-timeout 600000
910
11+ COPY src/ src
12+ COPY nginx.conf .
13+ COPY tsconfig.json .
14+ COPY vite.config.mts .
1015COPY . .
1116
12- RUN echo `git rev-parse --short HEAD` > health.html && \
13- echo "" >> .env && \
14- echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env && \
15- yarn build
17+ RUN echo `git rev-parse --short=9 HEAD` > health.html
1618
17- FROM fholzer/nginx-brotli:v1.26.2
19+ RUN echo "" >> .env && \
20+ echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short=9 HEAD)" >> .env
1821
19- # Install bash
20- RUN apk add --no-cache bash shadow
22+ RUN yarn build
2123
22- RUN useradd -m -s /bin/bash devtron
24+ FROM nginx:stable
2325
26+ RUN useradd -ms /bin/bash devtron
2427COPY --from=builder /app/dist/ /usr/share/nginx/html
2528COPY ./nginx.conf /etc/nginx/nginx.conf
2629COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
27-
2830WORKDIR /usr/share/nginx/html
31+ COPY --from=builder /app/./env.sh .
32+ COPY --from=builder /app/.env .
33+ COPY --from=builder /app/health.html .
2934
30-
31- COPY --from=builder /app/env.sh .
32- COPY --from=builder /app/.env .
33- COPY --from=builder /app/health.html .
34-
35- RUN chown -R devtron:devtron /usr/share/nginx/html && \
36- chmod +x env.sh
37-
35+ RUN chown -R devtron:devtron /usr/share/nginx/html
36+ # Make our shell script executable
37+ RUN chmod +x env.sh
3838USER devtron
39-
40- # Override the default ENTRYPOINT to allow shell scripting as fholzer/nginx-brotli has by-default entrypoint of nginx
41- ENTRYPOINT ["/bin/bash" , "-c" ]
42-
43- CMD ["./env.sh && nginx -g 'daemon off;'" ]
39+ CMD ["/bin/bash" , "-c" , "/usr/share/nginx/html/env.sh && nginx -g \" daemon off;\" " ]
0 commit comments