-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 691 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy project files
COPY ["AccessTrackAPI.csproj", "./"]
COPY ["src/", "src/"]
RUN dotnet restore "AccessTrackAPI.csproj"
# Copy everything else and build
COPY . .
WORKDIR "/src"
RUN dotnet build "AccessTrackAPI.csproj" -c Release -o /app/build
# Publish stage
FROM build AS publish
RUN dotnet publish "AccessTrackAPI.csproj" -c Release -o /app/publish
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
# Set environment variables
ENV ASPNETCORE_ENVIRONMENT=Development
ENV ASPNETCORE_URLS=http://+:80
ENTRYPOINT ["dotnet", "AccessTrackAPI.dll"]