1
1
FROM node:20-alpine AS builder
2
2
3
- WORKDIR /app
3
+ RUN apk add --no-cache git
4
4
5
- COPY package.json yarn.lock .
5
+ WORKDIR /app
6
+ COPY package.json .
7
+ COPY yarn.lock .
6
8
7
- RUN apk add --no-cache git
8
9
RUN yarn install --frozen-lockfile --network-timeout 600000
9
10
11
+ COPY src/ src
12
+ COPY nginx.conf .
13
+ COPY tsconfig.json .
14
+ COPY vite.config.mts .
10
15
COPY . .
11
16
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
16
18
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
18
21
19
- # Install bash
20
- RUN apk add --no-cache bash shadow
22
+ RUN yarn build
21
23
22
- RUN useradd -m -s /bin/bash devtron
24
+ FROM nginx:stable
23
25
26
+ RUN useradd -ms /bin/bash devtron
24
27
COPY --from=builder /app/dist/ /usr/share/nginx/html
25
28
COPY ./nginx.conf /etc/nginx/nginx.conf
26
29
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
27
-
28
30
WORKDIR /usr/share/nginx/html
31
+ COPY --from=builder /app/./env.sh .
32
+ COPY --from=builder /app/.env .
33
+ COPY --from=builder /app/health.html .
29
34
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
38
38
USER 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