-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfiles and project files for Argon.Api and Entry
- Add <DockerfileContext> property to Argon.Api.csproj and Argon.Entry.csproj - Reformat <Compile>, <None>, <PackageReference>, and <ProjectReference> elements in Argon.Api.csproj - Add Microsoft.VisualStudio.Azure.Containers.Tools.Targets package to both projects - Remove <Content> element for .dockerignore from both projects - Change base image in Dockerfiles to ghcr.io/argon-chat/secrets:4 - Remove EXPOSE 8081 from Argon.Api Dockerfile - Update COPY command in Dockerfiles to include ["Directory.Build.props", "."] - Use relative paths for dotnet restore, build, and publish commands in Dockerfiles - Add environment variables for Kestrel HTTPS certificate paths in Dockerfiles - Reformat ENTRYPOINT command in Dockerfiles - Update launchSettings.json for Docker profiles with new environment variables and schema position
- Loading branch information
Showing
6 changed files
with
99 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
FROM ghcr.io/argon-chat/secrets:4 AS base | ||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Directory.Build.props", "."] | ||
COPY ["src/Argon.Api/Argon.Api.csproj", "src/Argon.Api/"] | ||
COPY ["src/Argon.Contracts/Argon.Shared.csproj", "src/Argon.Contracts/"] | ||
COPY ["src/ServiceDefaults/ServiceDefaults.csproj", "src/ServiceDefaults/"] | ||
RUN dotnet restore "src/Argon.Api/Argon.Api.csproj" | ||
RUN dotnet restore "./src/Argon.Api/Argon.Api.csproj" | ||
COPY . . | ||
WORKDIR "/src/src/Argon.Api" | ||
RUN dotnet build "Argon.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
RUN dotnet build "./Argon.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Argon.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
RUN dotnet publish "./Argon.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
COPY src/Argon.Api/Migrations/*.sql /app/publish/Migrations/ | ||
|
||
FROM base AS final | ||
ENV Kestrel__Endpoints__Https__Certificate__Path="/origin.argon.gl.pem" \ | ||
Kestrel__Endpoints__Https__Certificate__KeyPath="/origin.argon.gl.key" | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Argon.Api.dll"] | ||
ENTRYPOINT ["dotnet", "Argon.Api.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": false, | ||
"launchUrl": "swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"dotnetRunMessages": true | ||
}, | ||
"Container (Dockerfile)": { | ||
"commandName": "Docker", | ||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_HTTP_PORTS": "8080" | ||
}, | ||
"publishAllPorts": true, | ||
"useSSL": false | ||
} | ||
} | ||
} | ||
}, | ||
"$schema": "http://json.schemastore.org/launchsettings.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters