diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4038f57 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,63 @@ +version: '3.8' + +services: + postgres: + image: postgres:16-alpine + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: incidentops + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + + redis: + image: redis:7-alpine + ports: + - "6379:6379" + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 5s + retries: 5 + + api: + build: + context: . + dockerfile: src/IncidentOps.Api/Dockerfile + ports: + - "8080:8080" + environment: + - ConnectionStrings__Postgres=Host=postgres;Port=5432;Database=incidentops;Username=postgres;Password=postgres + - Redis__ConnectionString=redis:6379 + - Jwt__SigningKey=your-super-secret-key-that-should-be-at-least-32-characters-long + - Jwt__Issuer=incidentops + - Jwt__Audience=incidentops + - Cors__Origins__0=http://localhost:3000 + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + + worker: + build: + context: . + dockerfile: src/IncidentOps.Worker/Dockerfile + environment: + - ConnectionStrings__Postgres=Host=postgres;Port=5432;Database=incidentops;Username=postgres;Password=postgres + - Redis__ConnectionString=redis:6379 + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + +volumes: + postgres_data: