Skip to content

Commit

Permalink
Define SOLUTION_NAME as env variable (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bardin08 authored May 18, 2024
2 parents 5b84832 + f9ab8d5 commit b8b7e84
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions TemplateService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ COPY ./ ./
ARG NUGET_API_KEY
ARG SOLUTION_NAME

RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json --name github --username trumpee --password $NUGET_API_KEY --store-password-in-clear-text
RUN ls -alF && dotnet restore "$SOLUTION_NAME.sln" --source "https://api.nuget.org/v3/index.json" --source "https://nuget.pkg.github.com/trumpee/index.json"
RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json \
--name github \
--username trumpee \
--password $NUGET_API_KEY \
--store-password-in-clear-text

RUN dotnet restore "$SOLUTION_NAME.sln" \
--source "https://api.nuget.org/v3/index.json" \
--source "https://nuget.pkg.github.com/trumpee/index.json"

RUN dotnet build "$SOLUTION_NAME.sln" -c Release -o /app/build --no-restore

FROM build AS publish
RUN dotnet publish "$SOLUTION_NAME.sln" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

ARG SOLUTION_NAME
ENV SOLUTION_NAME=$SOLUTION_NAME

WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "$SOLUTION_NAME.dll"]

0 comments on commit b8b7e84

Please sign in to comment.