From b9912b95eb903b100c82b16c4bdc7324189fb82f Mon Sep 17 00:00:00 2001 From: Alexandros Kritikos Date: Fri, 20 Mar 2026 12:59:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1=20Adds=20compose=20sample=20for=20?= =?UTF-8?q?referecne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/compose.sample.yaml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docker/compose.sample.yaml diff --git a/docker/compose.sample.yaml b/docker/compose.sample.yaml new file mode 100644 index 0000000..3f6ed46 --- /dev/null +++ b/docker/compose.sample.yaml @@ -0,0 +1,79 @@ +# Move this file to the root of the repo and drop the sample from the name to use it as the default compose file for development and testing. + +services: + sample-cli: + build: + context: .. + dockerfile: docker/Dockerfile + target: final + args: + PUBLISHED_PROJECT: SampleCli + RUNTIME_BASE: app + restart: no + + sample-api: + build: + context: .. + dockerfile: docker/Dockerfile + target: final + args: + PUBLISHED_PROJECT: SampleApi + RUNTIME_BASE: web + ports: + - "8080:8080" + environment: + - ASPNETCORE_URLS=http://+:8080 + - ASPNETCORE_ENVIRONMENT=Development + + sample-api-self-contained: + build: + context: .. + dockerfile: docker/Dockerfile + target: final + args: + PUBLISHED_PROJECT: SampleApi + RUNTIME_BASE: self-contained + depends_on: + sample-api-migrate: + condition: service_completed_successfully + ports: + - "8081:8080" + environment: + - ASPNETCORE_URLS=http://+:8080 + - ASPNETCORE_ENVIRONMENT=Development + + sample-api-migrate-database: + build: + context: .. + dockerfile: docker/Dockerfile + target: migrations + args: + PUBLISHED_PROJECT: SampleApi + EFPROJECT: Sample.Data + restart: no + ports: + - "8081:8080" + + sample-api-pack: + build: + context: .. + dockerfile: docker/Dockerfile + target: pack + args: + CONFIGURATION: Release + DOTNET_VERSION: "10.0" + volumes: + - ../artifacts/nuget/:/packages/ + entrypoint: [ "sh", "-c", "cp /app/publish/*.nupkg /packages/ 2>/dev/null; echo 'Packages copied to ./packages/'" ] + + sample-api-publish: + build: + context: .. + dockerfile: docker/Dockerfile + target: publish + args: + PUBLISHED_PROJECT: SampleApi + RUNTIME_BASE: web + volumes: + - ../artifacts/upload/:/output/ + entrypoint: [ "sh", "-c", "cp -r /app/publish/* /output/ && echo 'Published output copied to ./upload/'" ]