Skip to content

Commit

Permalink
Aspnet 8.0 (#538)
Browse files Browse the repository at this point in the history
* Update to debian 12

* Correctly load the GPG Key for debian 12

* Try to enforce port 80
  • Loading branch information
DrizzlyOwl authored Jul 22, 2024
1 parent 85934bf commit a366f96
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN touch /app/SQL/DbMigrationScript.sql
RUN --mount=type=secret,id=github_token dotnet nuget add source --username USERNAME --password $(cat /run/secrets/github_token) --store-password-in-clear-text --name github "https://nuget.pkg.github.com/DFE-Digital/index.json"
RUN dotnet restore TramsDataApi.sln
RUN dotnet new tool-manifest
RUN dotnet tool install dotnet-ef --version 6.0.5
RUN dotnet tool install dotnet-ef --version 8.0.7
ENV PATH="$PATH:/root/.dotnet/tools"

RUN dotnet ef migrations script --output /app/SQL/DbMigrationScriptLegacy.sql --project TramsDataApi --context TramsDataApi.DatabaseModels.LegacyTramsDbContext --idempotent -v
Expand All @@ -23,12 +23,12 @@ RUN dotnet build -c Release TramsDataApi.sln --no-restore
RUN dotnet publish TramsDataApi -c Release -o /app --no-restore

ARG ASPNET_IMAGE_TAG
FROM mcr.microsoft.com/dotnet/aspnet:7.0.20-bullseye-slim AS final
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS final

RUN apt-get update
RUN apt-get install unixodbc curl gnupg -y
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/11/prod.list | tee /etc/apt/sources.list.d/msprod.list
RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
RUN curl https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/msprod.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install msodbcsql18 mssql-tools18 -y

Expand All @@ -37,4 +37,6 @@ COPY --from=build /app /app
WORKDIR /app
COPY ./script/web-docker-entrypoint.sh ./docker-entrypoint.sh
RUN chmod +x ./docker-entrypoint.sh

ENV ASPNETCORE_HTTP_PORTS 80
EXPOSE 80/tcp

0 comments on commit a366f96

Please sign in to comment.