# Build from the repository root:  docker build -f VocaluxeSongServer/Dockerfile -t vocaluxe-song-server .
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY Directory.Build.props NuGet.Config ./
COPY VocaluxeSongServer/VocaluxeSongServer.csproj VocaluxeSongServer/
RUN dotnet restore VocaluxeSongServer/VocaluxeSongServer.csproj
COPY VocaluxeSongServer/ VocaluxeSongServer/
RUN dotnet publish VocaluxeSongServer/VocaluxeSongServer.csproj -c ReleaseLinux --no-restore -o /app

FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app .
# The song library (read-only is enough); see README.md
VOLUME /songs
ENV Library__Path=/songs
EXPOSE 8080
USER $APP_UID
ENTRYPOINT ["dotnet", "VocaluxeSongServer.dll"]
