fix deploy config

This commit is contained in:
motahhari
2026-06-03 03:20:16 +03:30
parent a2140fadc3
commit 1fb1081af5
3 changed files with 42 additions and 12 deletions

View File

@@ -1,29 +1,22 @@
# مرحله 1: Build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
# کپی فایل‌های پروژه به دایرکتوری کاری
COPY ["Complex.EndPoint/Complex.EndPoint.csproj", "Complex.EndPoint/"]
COPY nuget.config /
COPY Complex.EndPoint/Complex.EndPoint.csproj Complex.EndPoint/
COPY Complex.Application/Complex.Application.csproj Complex.Application/
COPY Complex.Domain/Complex.Domain.csproj Complex.Domain/
COPY Complex.Infrastructure/Complex.Infrastructure.csproj Complex.Infrastructure/
# بازیابی پکیج‌ها
RUN dotnet restore "Complex.EndPoint/Complex.EndPoint.csproj"
# کپی بقیه کدهای پروژه
COPY . .
# ساخت پروژه با حالت Release
RUN dotnet publish "Complex.EndPoint/Complex.EndPoint.csproj" -c Release -o /app/publish
# مرحله 2: Runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app
# کپی خروجی Publish از مرحله Build
COPY --from=build /app/publish .
EXPOSE 80
# تعیین نقطه شروع کانتینر
ENTRYPOINT ["dotnet", "Complex.EndPoint.dll"]
# مشخص کردن پورت (اگر پروژه روی 80 یا 5000 است آن را تنظیم کن)