|
Last change
on this file 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
|
|---|
| 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|---|
| 3 | WORKDIR /src
|
|---|
| 4 |
|
|---|
| 5 | # Copy csproj and restore dependencies
|
|---|
| 6 | COPY ["iknow-api/iknow-api.csproj", "iknow-api/"]
|
|---|
| 7 | RUN dotnet restore "iknow-api/iknow-api.csproj"
|
|---|
| 8 |
|
|---|
| 9 | # Copy the rest of the files and build
|
|---|
| 10 | COPY . .
|
|---|
| 11 | WORKDIR "/src/iknow-api"
|
|---|
| 12 | RUN dotnet build "iknow-api.csproj" -c Release -o /app/build
|
|---|
| 13 |
|
|---|
| 14 | # Publish the application
|
|---|
| 15 | FROM build AS publish
|
|---|
| 16 | RUN dotnet publish "iknow-api.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|---|
| 17 |
|
|---|
| 18 | # Use the runtime image for the final stage
|
|---|
| 19 | FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
|---|
| 20 | WORKDIR /app
|
|---|
| 21 | EXPOSE 8080
|
|---|
| 22 | COPY --from=publish /app/publish .
|
|---|
| 23 |
|
|---|
| 24 | # Set environment variables
|
|---|
| 25 | ENV ASPNETCORE_URLS=http://+:8080
|
|---|
| 26 |
|
|---|
| 27 | ENTRYPOINT ["dotnet", "iknow-api.dll"]
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.