Files
whms-lte-fs/Dockerfile
T
2026-07-21 15:03:40 +07:00

45 lines
1.4 KiB
Docker

# =====================================================================
# Dockerfile untuk WHMS-LTE-FS (ASP.NET Core .NET 9 - Multi-project)
# =====================================================================
# Struktur: Core/, Infrastructure/, Presentation/ASPNET (entry point)
# =====================================================================
# ---- STAGE 1: BUILD ----
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy solution dan project files untuk restore cache
COPY *.sln .
COPY Core/Application/Application.csproj Core/Application/
COPY Core/Domain/Domain.csproj Core/Domain/
COPY Infrastructure/Infrastructure/Infrastructure.csproj Infrastructure/Infrastructure/
COPY Presentation/ASPNET/ASPNET.csproj Presentation/ASPNET/
# Restore dependencies
RUN dotnet restore Presentation/ASPNET/ASPNET.csproj
# Copy semua source code
COPY . .
# Build dan publish
RUN dotnet publish Presentation/ASPNET/ASPNET.csproj -c Release -o /app --no-restore
# ---- STAGE 2: RUN ----
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
# Copy hasil build
COPY --from=build /app .
# Set environment
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:8080
# Expose port
EXPOSE 8080
# Create logs directory
RUN mkdir -p wwwroot/app_data/logs wwwroot/app_data/images wwwroot/app_data/docs
# Jalankan aplikasi
ENTRYPOINT ["dotnet", "ASPNET.dll"]