|
|
|
@ -1,20 +1,7 @@
|
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
|
|
|
ARG BUILD_CONFIGURATION=Release
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# RUN dotnet tool install --global dotnet-ef --version 8.0
|
|
|
|
|
# ENV PATH="${PATH}:/root/.dotnet/tools"
|
|
|
|
|
|
|
|
|
|
# Add the migrations
|
|
|
|
|
# RUN dotnet-ef migrations add --project StubbedContextLib/StubbedContextLib.csproj --startup-project HeartTrackAPI/HeartTrackAPI.csproj --context StubbedContextLib.TrainingStubbedContext --configuration Debug Initial
|
|
|
|
|
# Update the database
|
|
|
|
|
# RUN dotnet-ef database update --project StubbedContextLib/StubbedContextLib.csproj --startup-project HeartTrackAPI/HeartTrackAPI.csproj --context StubbedContextLib.TrainingStubbedContext --configuration Debug
|
|
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
RUN chown -R app:app HeartTrackAPI/
|
|
|
|
|
|
|
|
|
|
WORKDIR /src/HeartTrackAPI
|
|
|
|
|
ARG BUILD_CONFIGURATION=Release
|
|
|
|
|
RUN dotnet publish "HeartTrackAPI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
|
|
@ -24,8 +11,6 @@ USER $APP_UID
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY --from=build /app/publish .
|
|
|
|
|
COPY --from=build /src/HeartTrackAPI/uca.HeartTrack.db .
|
|
|
|
|
#RUN ls -l uca.HeartTrack.db
|
|
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
EXPOSE 8081
|
|
|
|
|