55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
# Kit template — copy to the deploy host as /opt/<repo-slug>/docker-compose.prod.yml
|
|
# (or ship from the repo and scp in CD).
|
|
#
|
|
# Runs app containers only. Shared Postgres/RabbitMQ/Redis/Seq live on the
|
|
# external "shared-services" network and must already exist.
|
|
#
|
|
# docker compose -f docker-compose.prod.yml --env-file .env up -d
|
|
#
|
|
# Substitute: <repo-slug>, image names, env keys your app needs.
|
|
|
|
name: myapp
|
|
|
|
services:
|
|
api:
|
|
image: ${REGISTRY}/<repo-slug>-api:${IMAGE_TAG}
|
|
container_name: myapp_api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${API_PORT:-8100}:8080"
|
|
environment:
|
|
ASPNETCORE_ENVIRONMENT: Production
|
|
ConnectionStrings__Default: "${PG_CONNECTION}"
|
|
Auth__ApiKey: "${API_KEY}"
|
|
networks:
|
|
- myapp_prod
|
|
- shared-services
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "50m", max-file: "5" }
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 1G }
|
|
|
|
# Optional SPA / static UI image — delete if CD only ships the API.
|
|
ui:
|
|
image: ${REGISTRY}/<repo-slug>-ui:${IMAGE_TAG}
|
|
container_name: myapp_ui
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${UI_PORT:-8101}:80"
|
|
networks:
|
|
- myapp_prod
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "20m", max-file: "3" }
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 256M }
|
|
|
|
networks:
|
|
myapp_prod:
|
|
driver: bridge
|
|
shared-services:
|
|
external: true
|