This commit is contained in:
xiaolipro 2025-01-05 20:47:36 +08:00
parent bf92c013f5
commit 821e2bd879
3 changed files with 7 additions and 17 deletions

View File

@ -4,3 +4,5 @@
build: build:
context: . context: .
dockerfile: src/InterfaceForward.Api/Dockerfile dockerfile: src/InterfaceForward.Api/Dockerfile
ports:
- "8888:8888"

View File

@ -1,5 +1,5 @@
{ {
"sdk": { "sdk": {
"version": "8.0.100" "version": "8.0.303"
} }
} }

View File

@ -1,21 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base FROM mcr.microsoft.com/dotnet/sdk:8.0.303 AS build
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["src/InterfaceForward.Api/InterfaceForward.Api.csproj", "src/InterfaceForward.Api/"] COPY . /src
COPY ["src/InterfaceForward.Application/InterfaceForward.Application.csproj", "src/InterfaceForward.Application/"]
COPY ["src/InterfaceForward.Application.Contracts/InterfaceForward.Application.Contracts.csproj", "src/InterfaceForward.Application.Contracts/"]
COPY ["src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj", "src/InterfaceForward.Domain.Shared/"]
COPY ["src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj", "src/InterfaceForward.Repositories/"]
COPY ["src/InterfaceForward.ServiceDefaults/InterfaceForward.ServiceDefaults.csproj", "src/InterfaceForward.ServiceDefaults/"]
RUN dotnet restore "src/InterfaceForward.Api/InterfaceForward.Api.csproj" RUN dotnet restore "src/InterfaceForward.Api/InterfaceForward.Api.csproj"
COPY . . WORKDIR "/src/InterfaceForward.Api"
WORKDIR "/src/src/InterfaceForward.Api"
RUN dotnet build "InterfaceForward.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build RUN dotnet build "InterfaceForward.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish