-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile to streamline build process (#1208)
* Refactor Dockerfile to streamline build process and set environment variables * Clean up Dockerfile by removing commented environment variable definitions
- Loading branch information
Showing
1 changed file
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
# Building accessmanagement frontend | ||
FROM node:22-slim AS generate-accessmanagement-frontend | ||
# FROM node:lts as generate-accessmanagement-frontend | ||
|
||
WORKDIR /build | ||
COPY . . | ||
RUN corepack enable | ||
RUN yarn --immutable | ||
RUN yarn build | ||
RUN corepack enable && \ | ||
yarn --immutable && \ | ||
yarn build | ||
|
||
# Building the backend | ||
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS generate-accessmanagement-backend | ||
|
||
WORKDIR /build | ||
COPY backend . | ||
RUN dotnet build src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.csproj -c Release -o /app_output | ||
RUN dotnet publish src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.csproj -c Release -o /app_output | ||
|
||
# Building the final image | ||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final | ||
EXPOSE 80 | ||
#EXPOSE 443 | ||
|
||
WORKDIR /app | ||
# ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ | ||
# DOTNET_RUNNING_IN_CONTAINER=true | ||
ENV ASPNETCORE_ENVIRONMENT = Development | ||
ENV ASPNETCORE_HTTP_PORTS = 80 | ||
EXPOSE 80 | ||
|
||
ENV ASPNETCORE_ENVIRONMENT=Development | ||
ENV ASPNETCORE_HTTP_PORTS=80 | ||
|
||
COPY --from=generate-accessmanagement-backend /app_output . | ||
COPY --from=generate-accessmanagement-frontend /build/dist/assets ./wwwroot/accessmanagement/assets | ||
COPY --from=generate-accessmanagement-frontend /build/src/localizations ./wwwroot/accessmanagement/localizations | ||
COPY --from=generate-accessmanagement-frontend /build/dist/manifest.json ./wwwroot/accessmanagement | ||
|
||
RUN mkdir /tmp/logtelemetry | ||
ENTRYPOINT ["dotnet", "Altinn.AccessManagement.UI.dll"] | ||
|
||
ENTRYPOINT ["dotnet", "Altinn.AccessManagement.UI.dll"] |