Skip to content

Commit eeb574a

Browse files
authored
Merge pull request #2790 from devtron-labs/fix-revert-brotli
fix: revert brotli compression
2 parents f6fd3da + bf31c17 commit eeb574a

File tree

3 files changed

+22
-33
lines changed

3 files changed

+22
-33
lines changed

Dockerfile

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
11
FROM 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
89
RUN 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 .
1015
COPY . .
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
2427
COPY --from=builder /app/dist/ /usr/share/nginx/html
2528
COPY ./nginx.conf /etc/nginx/nginx.conf
2629
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
27-
2830
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 .
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
3838
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;\""]

nginx.conf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ http {
2020
#tcp_nopush on;
2121
keepalive_timeout 65;
2222

23-
# gzip compression
2423
gzip on;
2524
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
2625
gzip_vary on;
@@ -29,11 +28,5 @@ http {
2928
gzip_comp_level 6;
3029
gzip_static on;
3130

32-
# btrotli compression
33-
brotli on;
34-
brotli_comp_level 6;
35-
brotli_static on;
36-
brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
37-
3831
include /etc/nginx/conf.d/*.conf;
3932
}

vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export default defineConfig(({ mode }) => {
184184
svgrOptions: {},
185185
}),
186186
compression({
187-
algorithm: 'brotliCompress',
187+
algorithm: 'gzip',
188188
}),
189189
reactVirtualized(),
190190
requireTransform(),

0 commit comments

Comments
 (0)