fix deploy config
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -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 است آن را تنظیم کن)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user