💡 Adds compose sample for referecne

This commit is contained in:
2026-03-20 12:59:18 +02:00
parent d3454f5327
commit b9912b95eb

View File

@@ -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/'" ]