containers building

This commit is contained in:
andy 2022-02-13 12:40:30 +00:00
parent 9dd922efac
commit 6461e31959
3 changed files with 14 additions and 12 deletions

View File

@ -6,15 +6,14 @@ COPY Selector.Cache/*.csproj ./Selector.Cache/
COPY Selector.Event/*.csproj ./Selector.Event/
COPY Selector.Model/*.csproj ./Selector.Model/
COPY Selector.CLI/*.csproj ./Selector.CLI/
RUN dotnet restore
RUN dotnet restore ./Selector.CLI/Selector.CLI.csproj
COPY . ./
RUN dotnet publish Selector.CLI/Selector.CLI.csproj -c Release
COPY ./Selector.CLI/bin/Release/net6.0/publish/ App/
RUN dotnet publish Selector.CLI/Selector.CLI.csproj -c Release -o /app --no-restore
FROM mcr.microsoft.com/dotnet/runtime:6.0
COPY --from=build bin/Release/net6.0/publish/ App/
WORKDIR /App
WORKDIR /app
COPY --from=build /app ./
ENV DOTNET_EnableDiagnostics=0
ENTRYPOINT ["dotnet", "Selector.CLI.dll"]

View File

@ -6,15 +6,14 @@ COPY Selector.Cache/*.csproj ./Selector.Cache/
COPY Selector.Event/*.csproj ./Selector.Event/
COPY Selector.Model/*.csproj ./Selector.Model/
COPY Selector.Web/*.csproj ./Selector.Web/
RUN dotnet restore
RUN dotnet restore ./Selector.Web/Selector.Web.csproj
COPY . ./
RUN dotnet publish Selector.Web/Selector.Web.csproj -c Release
COPY ./Selector.Web/bin/Release/net6.0/publish/ App/
RUN dotnet publish Selector.Web/Selector.Web.csproj -c Release -o /app --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:6.0
EXPOSE 80
COPY --from=build Selector.Web/bin/Release/net6.0/publish/ App/
WORKDIR /App
WORKDIR /app
COPY --from=build /app ./
ENV DOTNET_EnableDiagnostics=0
ENTRYPOINT ["dotnet", "Selector.Web.dll"]

View File

@ -1,11 +1,15 @@
version: "3.9" # optional since v1.27.0
services:
web:
build: Selector.Web/
build:
context: .
dockerfile: Dockerfile.Web
ports:
- "8080:80"
cli:
build: Selector.CLI/
build:
context: .
dockerfile: Dockerfile.CLI
redis:
image: redis:alpine
database: