Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ COPY eform-client ./
RUN apt-get update
RUN apt-get -y -q install ca-certificates
RUN yarn install
RUN yarn build
RUN if [ "$DISABLE_SENTRY" = "true" ]; then \
echo "Building with Sentry disabled (docker configuration)"; \
yarn build --configuration=docker; \
else \
echo "Building with Sentry enabled (production configuration)"; \
yarn build; \
fi
RUN if [ -n "$SENTRY_AUTH_TOKEN" ] && [ "$DISABLE_SENTRY" != "true" ]; then yarn sentrysourcemap; else echo "Sentry sourcemap upload skipped (DISABLE_SENTRY=$DISABLE_SENTRY)"; fi

FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build-env
Expand Down
12 changes: 11 additions & 1 deletion Dockerfile-big
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
FROM node:18.12.1 as node-env
WORKDIR /app
ARG DISABLE_SENTRY
ENV PATH /app/node_modules/.bin:$PATH
COPY eform-client ./
RUN npm install
RUN npm run build
RUN if [ "$DISABLE_SENTRY" = "true" ]; then \
echo "Building with Sentry disabled (docker configuration)"; \
npm run build -- --configuration=docker; \
else \
echo "Building with Sentry enabled (production configuration)"; \
npm run build; \
fi

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env
WORKDIR /app
ARG GITVERSION
ARG DISABLE_SENTRY

# Copy csproj and restore as distinct layers
COPY eFormAPI/eFormAPI.Web ./
Expand All @@ -17,6 +25,8 @@ RUN pwd
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
ARG DISABLE_SENTRY
ENV DISABLE_SENTRY=${DISABLE_SENTRY}
COPY --from=build-env /app/out .
COPY --from=node-env /app/dist wwwroot
RUN rm connection.json; exit 0
Expand Down
20 changes: 20 additions & 0 deletions eform-client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@
"namedChunks": false,
"aot": true,
"extractLicenses": true
},
"docker": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.docker.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true
}
},
"defaultConfiguration": "production"
Expand Down
5 changes: 5 additions & 0 deletions eform-client/src/environments/environment.docker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

export const environment = {
production: true,
enableSentry: false // Disable Sentry for Docker testing/CI
};
Loading