-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (31 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
33 lines (31 loc) · 1.04 KB
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
# Stage 1: Build frontend
ARG BUILDPLATFORM
FROM --platform=$BUILDPLATFORM node:22-alpine AS frontend
WORKDIR /src/AgarIA.Web
COPY AgarIA.Web/package.json ./
RUN npm install
COPY AgarIA.Web/ ./
RUN npm run build
# Stage 2: Build .NET application
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY AgarIA.slnx ./
COPY AgarIA.Core.Data/AgarIA.Core.Data.csproj AgarIA.Core.Data/
COPY AgarIA.Core.Repositories/AgarIA.Core.Repositories.csproj AgarIA.Core.Repositories/
COPY AgarIA.Core.Game/AgarIA.Core.Game.csproj AgarIA.Core.Game/
COPY AgarIA.Web/AgarIA.Web.csproj AgarIA.Web/
RUN dotnet restore AgarIA.slnx
COPY . .
COPY --from=frontend /src/AgarIA.Web/wwwroot/dist/ AgarIA.Web/wwwroot/dist/
RUN dotnet publish AgarIA.Web -c Release -o /app
# Stage 3: Runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app .
RUN mkdir -p /app/data
EXPOSE 8095
ENV DATA_DIR=/app/data
ENV ASPNETCORE_URLS=http://+:8095
ENV ASPNETCORE_ENVIRONMENT=Production
ENV Logging__LogLevel__Default=Warning
ENTRYPOINT ["dotnet", "AgarIA.Web.dll"]