-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (29 loc) · 888 Bytes
/
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
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG TARGETARCH
WORKDIR /source
COPY --link . .
RUN dotnet restore -a $TARGETARCH
RUN dotnet publish ./src/Borealis.Web/Borealis.Web.csproj -a $TARGETARCH --no-restore -o /app
# Build frontend
FROM node:22 AS frontend
WORKDIR /source
COPY --link ./src/Borealis.Frontend .
RUN yarn
RUN yarn build
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
RUN mkdir -p Database
RUN mkdir -p LuceneIndex
RUN mkdir -p wwwroot
RUN mkdir -p accounts
COPY --link --from=build /app .
COPY --link --from=frontend /source/artifacts ./wwwroot
USER $APP_UID
ENV ASPNETCORE_HTTP_PORTS=80;8080
ENV ASPNETCORE_HTTPS_PORTS=443;8081
EXPOSE 8080/tcp
EXPOSE 8081/tcp
ENTRYPOINT ["./Borealis.Web"]