-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (28 loc) · 1002 Bytes
/
Dockerfile
File metadata and controls
33 lines (28 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM node:22-bookworm-slim as node-env
WORKDIR /app
ARG SENTRY_AUTH_TOKEN
ARG DISABLE_SENTRY
ENV PATH /app/node_modules/.bin:$PATH
COPY eform-client ./
RUN apt-get update
RUN apt-get -y -q install ca-certificates
RUN yarn install
RUN yarn build
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
WORKDIR /app
ARG GITVERSION
ARG DISABLE_SENTRY
# Copy csproj and restore as distinct layers
COPY eFormAPI/eFormAPI.Web ./
RUN dotnet publish -o out /p:Version=$GITVERSION --runtime linux-x64 --configuration Release
RUN pwd
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble
WORKDIR /app
ARG DISABLE_SENTRY
ENV DISABLE_SENTRY=${DISABLE_SENTRY}
COPY --from=build-env /app/out .
COPY --from=node-env /app/dist/browser wwwroot
RUN rm connection.json; exit 0
ENTRYPOINT ["dotnet", "eFormAPI.Web.dll"]