dot-net/Dockerfile.alpine

23 lines
543 B
Docker
Raw Normal View History

2025-01-11 21:29:43 +00:00
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
2025-01-11 21:20:05 +00:00
WORKDIR /app
2025-01-12 00:17:23 +00:00
# Copy only what is neccesary for the build,
# so that small changes dont reset the whole build
COPY Controllers ./Controllers
COPY Migrations ./Migrations
COPY Model ./Model
COPY Properties ./Properties
COPY Program.cs .
COPY Trazo.csproj .
COPY WeatherForecast.cs .
COPY appsettings.json .
2025-01-11 21:20:05 +00:00
RUN dotnet restore
2025-01-12 00:17:23 +00:00
RUN dotnet publish -c Release -r linux-musl-x64 -o out
2025-01-11 21:20:05 +00:00
2025-01-11 21:29:43 +00:00
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
2025-01-11 21:20:05 +00:00
WORKDIR /app
COPY --from=build /app/out .
2025-01-11 22:17:14 +00:00
CMD ["./Trazo"]