-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 898 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (26 loc) · 898 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
29
30
31
32
33
34
# STAGE 1: Build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
# Copy the solution file and project files
COPY *.sln .
COPY GC.Domain/*.csproj GC.Domain/
COPY GC.Application/*.csproj GC.Application/
COPY GC.Infrastructure/*.csproj GC.Infrastructure/
COPY GC.API/*.csproj GC.API/
# Copy everything else
COPY . .
# Restore dependencies
RUN dotnet restore GlobalConnect.sln
# WORKDIR /app/src/GC.API
RUN dotnet publish -c Release -o /out GC.API/API.csproj
# STAGE 2: Run
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
# Copy the published output from the build stage
COPY --from=build /out .
# Copy your Static JSON data files (Important for your Reference Data logic)
# COPY --from=build /app/src/GlobalConnect.API/Data/Static ./Data/Static
# Set environment variables for Render
ENV ASPNETCORE_URLS=http://+:10000
EXPOSE 10000
ENTRYPOINT ["dotnet", "API.dll"]