- Add BuildKit cache mounts for NuGet and npm to persist package caches across builds - Skip redundant restore on dotnet publish with --no-restore - Add --prefer-offline to npm ci to prefer cached tarballs - Tag images as randall/backend:latest and randall/frontend:latest via compose image: key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
993 B
YAML
37 lines
993 B
YAML
services:
|
|
backend:
|
|
image: randall/backend:latest
|
|
build:
|
|
context: ../..
|
|
dockerfile: cicd/docker/Dockerfile.backend
|
|
environment:
|
|
- ConnectionStrings__DefaultConnection=Data Source=/app/data/randall.db
|
|
- Jwt__Key=${JWT_KEY:-randall-super-secret-jwt-key-change-in-production-32chars}
|
|
- Jwt__Issuer=${JWT_ISSUER:-randall-api}
|
|
- Jwt__Audience=${JWT_AUDIENCE:-randall-app}
|
|
- ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-Production}
|
|
volumes:
|
|
- db-data:/app/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "bash -c '</dev/tcp/localhost/8080'"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
frontend:
|
|
image: randall/frontend:latest
|
|
build:
|
|
context: ../..
|
|
dockerfile: cicd/docker/Dockerfile.frontend
|
|
ports:
|
|
- "${PORT:-80}:80"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
db-data:
|