Create new services: inventory, recipes, suppliers

This commit is contained in:
Urtzi Alfaro
2025-08-13 17:39:35 +02:00
parent fbe7470ad9
commit 16b8a9d50c
151 changed files with 35799 additions and 857 deletions

View File

@@ -22,6 +22,7 @@ volumes:
external_db_data:
tenant_db_data:
notification_db_data:
inventory_db_data:
redis_data:
rabbitmq_data:
prometheus_data:
@@ -189,7 +190,7 @@ services:
- external_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.26
ipv4_address: 172.20.0.24
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${EXTERNAL_DB_USER} -d ${EXTERNAL_DB_NAME}"]
interval: 10s
@@ -210,7 +211,7 @@ services:
- tenant_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.24
ipv4_address: 172.20.0.25
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${TENANT_DB_USER} -d ${TENANT_DB_NAME}"]
interval: 10s
@@ -231,13 +232,34 @@ services:
- notification_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.25
ipv4_address: 172.20.0.26
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${NOTIFICATION_DB_USER} -d ${NOTIFICATION_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
inventory-db:
image: postgres:15-alpine
container_name: bakery-inventory-db
restart: unless-stopped
environment:
- POSTGRES_DB=${INVENTORY_DB_NAME}
- POSTGRES_USER=${INVENTORY_DB_USER}
- POSTGRES_PASSWORD=${INVENTORY_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- inventory_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.27
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${INVENTORY_DB_USER} -d ${INVENTORY_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# ================================================================
# LOCATION SERVICES (NEW SECTION)
@@ -398,7 +420,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.105
ipv4_address: 172.20.0.102
volumes:
- log_storage:/app/logs
- ./services/tenant:/app
@@ -437,7 +459,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.102
ipv4_address: 172.20.0.103
volumes:
- log_storage:/app/logs
- model_storage:/app/models
@@ -480,7 +502,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.103
ipv4_address: 172.20.0.104
volumes:
- log_storage:/app/logs
- model_storage:/app/models
@@ -516,7 +538,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.104
ipv4_address: 172.20.0.105
volumes:
- log_storage:/app/logs
- ./services/sales:/app
@@ -551,7 +573,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.107
ipv4_address: 172.20.0.106
volumes:
- log_storage:/app/logs
- ./services/external:/app
@@ -586,7 +608,7 @@ services:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.106
ipv4_address: 172.20.0.107
volumes:
- log_storage:/app/logs
- ./services/notification:/app
@@ -597,6 +619,41 @@ services:
timeout: 10s
retries: 3
inventory-service:
build:
context: .
dockerfile: ./services/inventory/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/inventory-service:${IMAGE_TAG}
container_name: bakery-inventory-service
restart: unless-stopped
env_file: .env
ports:
- "${INVENTORY_SERVICE_PORT}:8000"
depends_on:
inventory-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.108
volumes:
- log_storage:/app/logs
- ./services/inventory:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# ================================================================
# MONITORING - SIMPLE APPROACH
# ================================================================