build: update linux.docker file
This commit is contained in:
parent
fe542d8131
commit
65926abb0b
|
@ -1,6 +1,9 @@
|
|||
name: Docker Image CI
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
|
||||
|
@ -11,4 +14,4 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file src/admin/Linux.Dockerfile --tag BA:$(date +%s)
|
||||
run: docker build . --file src/admin/Bootstrap.Admin/Linux.Dockerfile --tag ba:$(date +%s)
|
|
@ -7,19 +7,15 @@ EXPOSE 80
|
|||
|
||||
FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"]
|
||||
COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"]
|
||||
RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Bootstrap.Admin"
|
||||
RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app
|
||||
COPY src/admin .
|
||||
|
||||
WORKDIR "/src/Bootstrap.Admin"
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app
|
||||
RUN dotnet publish -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
COPY --from=build ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"]
|
||||
COPY --from=build ["/src/Scripts/Longbow.lic", "./Longbow.lic"]
|
||||
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"]
|
||||
COPY --from=publish ["/src/Longbow.lic", "./Longbow.lic"]
|
||||
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]
|
|
@ -1,22 +1,21 @@
|
|||
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
|
||||
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
|
||||
#For more information, please see https://aka.ms/containercompat
|
||||
|
||||
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM microsoft/dotnet:2.2-sdk AS build
|
||||
WORKDIR /src
|
||||
COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"]
|
||||
COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"]
|
||||
RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Bootstrap.Admin"
|
||||
RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app
|
||||
COPY src/admin .
|
||||
|
||||
WORKDIR "/src/Bootstrap.Admin"
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app
|
||||
RUN dotnet publish -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"]
|
||||
COPY --from=publish ["/src/Scripts/Longbow.lic", "./Longbow.lic"]
|
||||
COPY --from=publish ["/src/Longbow.lic", "./Longbow.lic"]
|
||||
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]
|
Loading…
Reference in New Issue