3e1cc696c1
- Aligns compose service name with the image name (hrynco.notification-service.web) - Rename API_PORT env var to WEB_PORT for consistency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
95 lines
2.9 KiB
YAML
95 lines
2.9 KiB
YAML
name: hrynco-notification-service
|
|
|
|
services:
|
|
migrator:
|
|
build:
|
|
context: ../..
|
|
dockerfile: HrynCo.NotificationService.Migrator/Dockerfile
|
|
environment:
|
|
- App__ConnectionString=Host=db;Port=5432;Database=${DB_NAME:?DB_NAME is required};Username=${DB_USER:?DB_USER is required};Password=${DB_PASS:?DB_PASS is required}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- internal
|
|
restart: "no"
|
|
|
|
web:
|
|
build:
|
|
context: ../..
|
|
dockerfile: HrynCo.NotificationService.Web/Dockerfile
|
|
environment:
|
|
- ASPNETCORE_ENVIRONMENT=Production
|
|
- App__ConnectionString=Host=db;Port=5432;Database=${DB_NAME:?DB_NAME is required};Username=${DB_USER:?DB_USER is required};Password=${DB_PASS:?DB_PASS is required}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
migrator:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- internal
|
|
|
|
worker:
|
|
build:
|
|
context: ../..
|
|
dockerfile: HrynCo.NotificationService.Worker/Dockerfile
|
|
environment:
|
|
- DOTNET_ENVIRONMENT=Production
|
|
- App__ConnectionString=Host=db;Port=5432;Database=${DB_NAME:?DB_NAME is required};Username=${DB_USER:?DB_USER is required};Password=${DB_PASS:?DB_PASS is required}
|
|
- App__RabbitMq__Host=rabbitmq
|
|
- App__RabbitMq__Port=5672
|
|
- App__RabbitMq__User=${RABBITMQ_USER:?RABBITMQ_USER is required}
|
|
- App__RabbitMq__Password=${RABBITMQ_PASSWORD:?RABBITMQ_PASSWORD is required}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
migrator:
|
|
condition: service_completed_successfully
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
networks:
|
|
- internal
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:4-management-alpine
|
|
environment:
|
|
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:?RABBITMQ_USER is required}
|
|
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:?RABBITMQ_PASSWORD is required}
|
|
ports:
|
|
- "${RABBITMQ_AMQP_PORT:?RABBITMQ_AMQP_PORT is required}:5672"
|
|
- "${RABBITMQ_MANAGEMENT_PORT:?RABBITMQ_MANAGEMENT_PORT is required}:15672"
|
|
volumes:
|
|
- rabbitmq_data:/var/lib/rabbitmq
|
|
networks:
|
|
- internal
|
|
healthcheck:
|
|
test: ["CMD", "rabbitmq-diagnostics", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
db:
|
|
image: postgres:17
|
|
environment:
|
|
- POSTGRES_DB=${DB_NAME:?DB_NAME is required}
|
|
- POSTGRES_USER=${DB_USER:?DB_USER is required}
|
|
- POSTGRES_PASSWORD=${DB_PASS:?DB_PASS is required}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
networks:
|
|
- internal
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
pgdata:
|
|
name: ${VOLUME_PREFIX:?VOLUME_PREFIX is required}-pgdata
|
|
rabbitmq_data:
|
|
name: ${VOLUME_PREFIX:?VOLUME_PREFIX is required}-rabbitmq-data
|
|
|
|
networks:
|
|
internal:
|
|
driver: bridge |