#FROM debian

# file: Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder

WORKDIR /app

# Copy everything from src-directory on host to workdir in image
COPY src .

# Build and publish a release to directory "out" (build implicitly restores NuGet packages)
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:7.0

# install GPIO library (don't clean, need cache :-)
RUN apt-get -y update && apt-get -y install gpiod libgpiod2 libgpiod-dev

# set build- and run-time working directory
WORKDIR /app

COPY --from=builder /app/out /app

CMD ["dotnet", "/app/ASYD_JoystickLeds.dll"]
