Skip to content

Commit 13b1d7f

Browse files
committed
fix: update Sentry configuration in Docker builds
Improves Sentry integration in Docker builds by: - Moving Sentry environment variables to build args - Adding .env to dockerignore for security - Properly passing Sentry configuration during build process This change ensures better security practices and more reliable Sentry configuration in containerized environments.
1 parent b4a5dd0 commit 13b1d7f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist
44
.git
55
.gitignore
66
*.md
7+
.env

.github/workflows/docker.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ jobs:
5050
push: true
5151
tags: ${{ steps.meta.outputs.tags }}
5252
labels: ${{ steps.meta.outputs.labels }}
53-
env:
54-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
55-
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
53+
build-args: |
54+
SENTRY_DSN=${{ secrets.SENTRY_DSN }}
55+
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
56+
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
5657
5758
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
5859
- name: Generate artifact attestation

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
1515

1616
FROM build-deps AS build
1717
COPY . .
18+
19+
ARG SENTRY_DSN
20+
ARG SENTRY_AUTH_TOKEN
21+
ARG SENTRY_PROJECT
22+
1823
RUN export $(cat .env.example) && \
1924
export DOCKER=true && \
2025
pnpm run build

0 commit comments

Comments
 (0)