Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
JonTaylorBCGov2 committed Jul 5, 2024
1 parent bd5beff commit 3222ed6
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,20 @@ ENV VERSION=$VERSION

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

# install diagnostics tools
RUN dotnet tool install --tool-path /tools dotnet-trace
RUN dotnet tool install --tool-path /tools dotnet-counters
RUN dotnet tool install --tool-path /tools dotnet-dump

WORKDIR /
WORKDIR /src

COPY ["api/api.csproj", "api/"]
COPY ["db/db.csproj", "db/"]
COPY ["jc-interface-client/jc-interface-client.csproj", "jc-interface-client/"]

RUN dotnet restore ./api/api.csproj
#RUN dotnet restore ./db/db.csproj
RUN dotnet restore api/api.csproj
RUN dotnet restore db/db.csproj
COPY . .

# Install Node.js and npm
RUN apt-get update
RUN apt-get install -y nodejs npm
RUN npm install -g autorest

# run unit tests
#RUN dotnet test -c Release

RUN dotnet build "api/api.csproj" -c Release
# build
FROM build AS publish
RUN dotnet publish "api/api.csproj" -c Release -o /app/publish
# --runtime linux-musl-x64 --no-self-contained
RUN dotnet publish "api/api.csproj" -c Release -o /app/publish --runtime linux-musl-x64 --no-self-contained

FROM base AS final
# copy diagnostics tools
WORKDIR /tools
COPY --from=build /tools .

# copy app
WORKDIR /app
COPY --from=publish /app/publish .
Expand Down

0 comments on commit 3222ed6

Please sign in to comment.