source: Dockerfile@ ea40556

Last change on this file since ea40556 was bb02e3a, checked in by Stefan-Saveski <stefansaveski19@…>, 9 months ago

Added dockerfile and changes to GET user.

  • Property mode set to 100644
File size: 772 bytes
Line 
1# Use the official .NET SDK image for building
2FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
3WORKDIR /src
4
5# Copy csproj and restore dependencies
6COPY ["iknow-api/iknow-api.csproj", "iknow-api/"]
7RUN dotnet restore "iknow-api/iknow-api.csproj"
8
9# Copy the rest of the files and build
10COPY . .
11WORKDIR "/src/iknow-api"
12RUN dotnet build "iknow-api.csproj" -c Release -o /app/build
13
14# Publish the application
15FROM build AS publish
16RUN dotnet publish "iknow-api.csproj" -c Release -o /app/publish /p:UseAppHost=false
17
18# Use the runtime image for the final stage
19FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
20WORKDIR /app
21EXPOSE 8080
22COPY --from=publish /app/publish .
23
24# Set environment variables
25ENV ASPNETCORE_URLS=http://+:8080
26
27ENTRYPOINT ["dotnet", "iknow-api.dll"]
Note: See TracBrowser for help on using the repository browser.