Skip to content

Commit

Permalink
feat: add support for adding the SENTRY_RELEASE_VERSION to .env durin…
Browse files Browse the repository at this point in the history
…g build
  • Loading branch information
eshankvaish committed Dec 4, 2024
1 parent 9fd53c7 commit 950ed9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 59 deletions.
19 changes: 5 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,24 @@ COPY vite.config.mts .
COPY . .

RUN echo `git rev-parse --short HEAD` > health.html
RUN echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env
RUN yarn build

FROM nginx:stable-alpine
RUN echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env

RUN apk add --no-cache nodejs npm bash
RUN yarn build

RUN addgroup -S devtron && adduser -S devtron -G devtron
FROM nginx:stable

RUN useradd -ms /bin/bash devtron
COPY --from=builder /app/dist/ /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf

WORKDIR /usr/share/nginx/html

COPY --from=builder /app/./env.sh .
COPY --from=builder /app/.env .
COPY --from=builder /app/./sentry.sh .
COPY --from=builder /app/health.html .

RUN chown -R devtron:devtron /usr/share/nginx/html

RUN npm install -g @sentry/cli

# Make our shell script executable
RUN chmod +x env.sh
RUN chmod +x sentry.sh

USER devtron
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && /usr/share/nginx/html/sentry.sh && nginx -g \"daemon off;\""]
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
45 changes: 0 additions & 45 deletions sentry.sh

This file was deleted.

0 comments on commit 950ed9b

Please sign in to comment.