forked from Altinn/altinn-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (36 loc) · 1.98 KB
/
Dockerfile
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
35
36
37
38
39
40
41
# Building studio frontend
FROM node:21.2.0-alpine AS generate-studio-frontend
WORKDIR /build
COPY . .
RUN corepack enable
RUN yarn --immutable
RUN yarn build
# Building the backend
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS generate-studio-backend
WORKDIR /build
COPY backend .
RUN dotnet build src/Designer/Designer.csproj -c Release -o /app_output
RUN dotnet publish src/Designer/Designer.csproj -c Release -o /app_output
RUN rm -f /app_output/Altinn.Studio.Designer.staticwebassets.runtime.json
# Prepare app template
WORKDIR /app_template
RUN apk add jq zip
RUN wget -O - https://api.github.com/repos/Altinn/app-template-dotnet/releases/latest | jq '.assets[]|select(.name | startswith("app-template-dotnet-") and endswith(".zip"))' | jq '.browser_download_url' | xargs wget -O apptemplate.zip && unzip apptemplate.zip && rm apptemplate.zip
# Building the final image
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS final
EXPOSE 80
WORKDIR /app
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
DOTNET_RUNNING_IN_CONTAINER=true
RUN apk add --no-cache icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib
COPY --from=generate-studio-backend /app_output .
COPY --from=generate-studio-frontend /build/frontend/dist/app-development ./wwwroot/designer/frontend/app-development
COPY --from=generate-studio-frontend /build/frontend/dist/app-preview ./wwwroot/designer/frontend/app-preview
COPY --from=generate-studio-frontend /build/frontend/dist/dashboard ./wwwroot/designer/frontend/dashboard
COPY --from=generate-studio-frontend /build/frontend/dist/resourceadm ./wwwroot/designer/frontend/resourceadm
COPY --from=generate-studio-frontend /build/frontend/dist/language ./wwwroot/designer/frontend/lang
COPY --from=generate-studio-frontend /build/frontend/dist/studio-root ./wwwroot/designer/frontend/studio-root
## Copying app template
COPY --from=generate-studio-backend /app_template ./Templates/AspNet
COPY backend/src/Designer/Migration ./Migration
ENTRYPOINT ["dotnet", "Altinn.Studio.Designer.dll"]