Ajout du dockerfile et du déploiement de l'api
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
8e0c19eea8
commit
475de804eb
@ -0,0 +1,25 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||||
|
WORKDIR /api
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["../API_SQLuedo/API/API.csproj", "API_SQLuedo/"]
|
||||||
|
|
||||||
|
# Restore dependencies
|
||||||
|
RUN dotnet restore "API_SQLuedo/API/API.csproj"
|
||||||
|
|
||||||
|
# Copy the rest of the files
|
||||||
|
COPY "../API_SQLuedo/API/." "API_SQLuedo/"
|
||||||
|
WORKDIR "/src/API_SQLuedo"
|
||||||
|
RUN dotnet build "API.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
# Publish the application
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "API.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
|
# Final image
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "API.dll"]
|
Loading…
Reference in new issue