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