Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Nov 15, 2023
1 parent da8d45a commit ff469d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/API/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
7 changes: 3 additions & 4 deletions src/API/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
LABEL maintainer="edi.wang@outlook.com"
LABEL repo="https://github.com/EdiWang/Elf"

USER app
WORKDIR /app
EXPOSE 8080
Expand All @@ -12,10 +11,10 @@ ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Elf.Api.csproj", "API/"]
RUN dotnet restore "./API/Elf.Api.csproj"
COPY ["Elf.Api.csproj", "."]
RUN dotnet restore "./././Elf.Api.csproj"
COPY . .
WORKDIR "/src/API"
WORKDIR "/src/."
RUN dotnet build "./Elf.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
Expand Down

0 comments on commit ff469d0

Please sign in to comment.