initial commit
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
# =====================================================================
|
||||
# Dockerfile untuk Blazor OMS (ASP.NET Core Blazor .NET 10)
|
||||
# =====================================================================
|
||||
# Multi-stage build:
|
||||
# Stage 1: Build aplikasi
|
||||
# Stage 2: Run production
|
||||
# =====================================================================
|
||||
|
||||
# ---- STAGE 1: BUILD ----
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copy csproj dan restore dependencies (cache layer)
|
||||
COPY *.csproj .
|
||||
RUN dotnet restore
|
||||
|
||||
# Copy semua source code dan build
|
||||
COPY . .
|
||||
RUN dotnet publish -c Release -o /app --no-restore
|
||||
|
||||
# ---- STAGE 2: RUN ----
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
||||
WORKDIR /app
|
||||
|
||||
# Install ICU libraries untuk Blazor
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libicu-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy hasil build dari stage 1
|
||||
COPY --from=build /app .
|
||||
|
||||
# Set environment ke Production
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
|
||||
# Jalankan aplikasi
|
||||
ENTRYPOINT ["dotnet", "Indotalent.dll"]
|
||||
Reference in New Issue
Block a user