-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (24 loc) · 949 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /source
# copy csproj and restore as distinct layers
COPY Muse.sln .
COPY src/Muse/*.csproj ./src/Muse/
COPY src/SpotifyApi/*.csproj ./src/SpotifyApi/
COPY src/SpotifyApi/src/SpotifyApi.NetCore/*.csproj /source/src/SpotifyApi/src/SpotifyApi.NetCore/
COPY src/BackgroundServices/*.csproj ./src/BackgroundServices/
COPY src/TSGenerator/*.csproj ./src/TSGenerator/
COPY src/TSGeneratorTests/*.csproj ./src/TSGeneratorTests/
RUN dotnet restore
RUN mkdir local_packages
RUN dotnet pack src/TSGenerator/TSGenerator.csproj
RUN cp src/TSGenerator/bin/Release/*.nupkg local_packages
RUN dotnet restore srs/TSGeneratorTests/TSGeneratorTests.csproj
# copy everything else and build app
COPY . .
WORKDIR /source/Muse
RUN dotnet publish -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "Muse.dll"]