-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (23 loc) · 1.58 KB
/
Copy pathDockerfile
File metadata and controls
26 lines (23 loc) · 1.58 KB
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
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /source
COPY CommunityPro.sln Directory.Build.props Directory.Packages.props ./
COPY src/CommunityPro.Api/CommunityPro.Api.csproj src/CommunityPro.Api/
COPY src/CommunityPro.SharedKernel/CommunityPro.SharedKernel.csproj src/CommunityPro.SharedKernel/
COPY src/Modules/CommunityPro.Admin/CommunityPro.Admin.csproj src/Modules/CommunityPro.Admin/
COPY src/Modules/CommunityPro.Content/CommunityPro.Content.csproj src/Modules/CommunityPro.Content/
COPY src/Modules/CommunityPro.Contributors/CommunityPro.Contributors.csproj src/Modules/CommunityPro.Contributors/
COPY src/Modules/CommunityPro.Identity/CommunityPro.Identity.csproj src/Modules/CommunityPro.Identity/
COPY src/Modules/CommunityPro.Members/CommunityPro.Members.csproj src/Modules/CommunityPro.Members/
COPY src/Modules/CommunityPro.Mentorship/CommunityPro.Mentorship.csproj src/Modules/CommunityPro.Mentorship/
COPY src/Modules/CommunityPro.Search/CommunityPro.Search.csproj src/Modules/CommunityPro.Search/
COPY src/Modules/CommunityPro.Sponsorship/CommunityPro.Sponsorship.csproj src/Modules/CommunityPro.Sponsorship/
COPY tests/CommunityPro.Tests/CommunityPro.Tests.csproj tests/CommunityPro.Tests/
RUN dotnet restore CommunityPro.sln
COPY . .
RUN dotnet publish src/CommunityPro.Api -c Release --no-restore -o /app
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app .
# why: PaaS hosts (Render) inject PORT; default to 8080 for local compose.
EXPOSE 8080
ENTRYPOINT ["/bin/sh", "-c", "ASPNETCORE_URLS=http://+:${PORT:-8080} exec dotnet CommunityPro.Api.dll"]