forked from equinor/sara
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 873 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (27 loc) · 873 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
34
# https://hub.docker.com/_/microsoft-dotnet
FROM node:24-slim AS frontend-build
ENV CI=true
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
COPY frontend/package.json frontend/pnpm-lock.yaml frontend/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY frontend/ .
RUN pnpm build --outDir /frontend-dist
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /source
# copy everything
COPY . .
WORKDIR /source/api
RUN dotnet publish -c release -o /app
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app ./
COPY --from=frontend-build /frontend-dist ./wwwroot
EXPOSE 8100
# Runtime user change to non-root for added security
RUN useradd -ms /bin/bash --uid 1001 isar
RUN chown -R 1001 /app
RUN chmod 755 /app
USER 1001
ENTRYPOINT ["dotnet", "api.dll", "--urls=http://0.0.0.0:8100"]