Dockerfile.unity-client•571 B
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
# Copy csproj and restore dependencies
COPY unity-client/*.csproj ./
RUN dotnet restore
# Copy the rest of the code
COPY unity-client/. ./
# Build the application
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app/out .
# Expose port 8081
EXPOSE 8081
# Set environment variables
ENV ASPNETCORE_URLS=http://+:8081
ENV ASPNETCORE_ENVIRONMENT=Production
# Start the application
ENTRYPOINT ["dotnet", "unity-client.dll"]