From 6dfc628088e4cee89d8e184c41f2b80adc3aea73 Mon Sep 17 00:00:00 2001 From: Elton Stoneman Date: Mon, 22 Oct 2018 11:27:04 +0100 Subject: [PATCH] Add Windows 1809 support --- docker-compose-windows-1809.yml | 48 ++++++++++++++++++++++++++++++++ docker-stack-windows-1809.yml | 49 +++++++++++++++++++++++++++++++++ result/dotnet/Dockerfile.1809 | 16 +++++++++++ vote/dotnet/Dockerfile.1809 | 16 +++++++++++ worker/dotnet/Dockerfile.1809 | 16 +++++++++++ 5 files changed, 145 insertions(+) create mode 100644 docker-compose-windows-1809.yml create mode 100644 docker-stack-windows-1809.yml create mode 100644 result/dotnet/Dockerfile.1809 create mode 100644 vote/dotnet/Dockerfile.1809 create mode 100644 worker/dotnet/Dockerfile.1809 diff --git a/docker-compose-windows-1809.yml b/docker-compose-windows-1809.yml new file mode 100644 index 0000000..dd3f435 --- /dev/null +++ b/docker-compose-windows-1809.yml @@ -0,0 +1,48 @@ +version: "3.2" + +services: + vote: + image: dockersamples/examplevotingapp_vote:dotnet-nanoserver-1809 + build: + context: ./vote/dotnet + dockerfile: Dockerfile.1809 + ports: + - "5000:80" + depends_on: + - message-queue + + result: + image: dockersamples/examplevotingapp_result:dotnet-nanoserver-1809 + build: + context: ./result/dotnet + dockerfile: Dockerfile.1809 + ports: + - "5001:80" + environment: + - "ConnectionStrings:ResultData=Server=db;Port=4000;Database=votes;User=root;SslMode=None" + depends_on: + - db + + worker: + image: dockersamples/examplevotingapp_worker:dotnet-nanoserver-1809 + build: + context: ./worker/dotnet + dockerfile: Dockerfile.1809 + environment: + - "ConnectionStrings:VoteData=Server=db;Port=4000;Database=votes;User=root;SslMode=None" + depends_on: + - message-queue + - db + + message-queue: + image: dockersamples/nats:nanoserver-1809 + + db: + image: dockersamples/tidb:nanoserver-1809 + ports: + - "3306:4000" + +networks: + default: + external: + name: nat \ No newline at end of file diff --git a/docker-stack-windows-1809.yml b/docker-stack-windows-1809.yml new file mode 100644 index 0000000..2001702 --- /dev/null +++ b/docker-stack-windows-1809.yml @@ -0,0 +1,49 @@ +version: "3.2" + +services: + vote: + image: dockersamples/examplevotingapp_vote:dotnet-nanoserver-1809 + ports: + - "5000:80" + deploy: + mode: replicated + replicas: 4 + networks: + - frontend + - backend + + result: + image: dockersamples/examplevotingapp_result:dotnet-nanoserver-1809 + environment: + - "ConnectionStrings:ResultData=Server=db;Port=4000;Database=votes;User=root;SslMode=None" + ports: + - "5001:80" + networks: + - frontend + - backend + + worker: + image: dockersamples/examplevotingapp_worker:dotnet-nanoserver-1809 + environment: + - "ConnectionStrings:VoteData=Server=db;Port=4000;Database=votes;User=root;SslMode=None" + deploy: + mode: replicated + replicas: 3 + networks: + - backend + + message-queue: + image: dockersamples/nats:nanoserver-1809 + networks: + - backend + + db: + image: dockersamples/tidb:nanoserver-1809 + ports: + - "3306:4000" + networks: + - backend + +networks: + frontend: + backend: \ No newline at end of file diff --git a/result/dotnet/Dockerfile.1809 b/result/dotnet/Dockerfile.1809 new file mode 100644 index 0000000..632a137 --- /dev/null +++ b/result/dotnet/Dockerfile.1809 @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder + +WORKDIR /Result +COPY Result/Result.csproj . +RUN dotnet restore + +COPY /Result . +RUN dotnet publish -c Release -o /out Result.csproj + +# app image +FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809 + +WORKDIR /app +ENTRYPOINT ["dotnet", "Result.dll"] + +COPY --from=builder /out . \ No newline at end of file diff --git a/vote/dotnet/Dockerfile.1809 b/vote/dotnet/Dockerfile.1809 new file mode 100644 index 0000000..13d33b7 --- /dev/null +++ b/vote/dotnet/Dockerfile.1809 @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder + +WORKDIR /Vote +COPY Vote/Vote.csproj . +RUN dotnet restore + +COPY /Vote . +RUN dotnet publish -c Release -o /out Vote.csproj + +# app image +FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809 + +WORKDIR /app +ENTRYPOINT ["dotnet", "Vote.dll"] + +COPY --from=builder /out . \ No newline at end of file diff --git a/worker/dotnet/Dockerfile.1809 b/worker/dotnet/Dockerfile.1809 new file mode 100644 index 0000000..ef98805 --- /dev/null +++ b/worker/dotnet/Dockerfile.1809 @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk-nanoserver-1809 as builder + +WORKDIR /Worker +COPY Worker/Worker.csproj . +RUN dotnet restore + +COPY /Worker . +RUN dotnet publish -c Release -o /out Worker.csproj + +# app image +FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1809 + +WORKDIR /app +ENTRYPOINT ["dotnet", "Worker.dll"] + +COPY --from=builder /out . \ No newline at end of file