Fix new services implementation 6

This commit is contained in:
Urtzi Alfaro
2025-08-15 18:09:35 +02:00
parent f7de9115d1
commit 277b1332cb
4 changed files with 122 additions and 2 deletions

View File

@@ -23,12 +23,15 @@ volumes:
tenant_db_data:
notification_db_data:
inventory_db_data:
recipes_db_data:
suppliers_db_data:
redis_data:
rabbitmq_data:
prometheus_data:
grafana_data:
model_storage:
log_storage:
nominatim_data:
# ================================================================
@@ -260,6 +263,48 @@ services:
timeout: 5s
retries: 5
recipes-db:
image: postgres:15-alpine
container_name: bakery-recipes-db
restart: unless-stopped
environment:
- POSTGRES_DB=${RECIPES_DB_NAME}
- POSTGRES_USER=${RECIPES_DB_USER}
- POSTGRES_PASSWORD=${RECIPES_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- recipes_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.28
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${RECIPES_DB_USER} -d ${RECIPES_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
suppliers-db:
image: postgres:15-alpine
container_name: bakery-suppliers-db
restart: unless-stopped
environment:
- POSTGRES_DB=${SUPPLIERS_DB_NAME}
- POSTGRES_USER=${SUPPLIERS_DB_USER}
- POSTGRES_PASSWORD=${SUPPLIERS_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- suppliers_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.29
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${SUPPLIERS_DB_USER} -d ${SUPPLIERS_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# ================================================================
# LOCATION SERVICES (NEW SECTION)
@@ -654,6 +699,80 @@ services:
timeout: 10s
retries: 3
recipes-service:
build:
context: .
dockerfile: ./services/recipes/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/recipes-service:${IMAGE_TAG}
container_name: bakery-recipes-service
restart: unless-stopped
env_file: .env
ports:
- "${RECIPES_SERVICE_PORT}:8000"
depends_on:
recipes-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
inventory-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.109
volumes:
- log_storage:/app/logs
- ./services/recipes:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
suppliers-service:
build:
context: .
dockerfile: ./services/suppliers/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/suppliers-service:${IMAGE_TAG}
container_name: bakery-suppliers-service
restart: unless-stopped
env_file: .env
ports:
- "${SUPPLIERS_SERVICE_PORT}:8000"
depends_on:
suppliers-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
inventory-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.111
volumes:
- log_storage:/app/logs
- ./services/suppliers:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# ================================================================
# MONITORING - SIMPLE APPROACH
# ================================================================

0
docs/FRONTEND.md Normal file
View File

View File

@@ -9,14 +9,14 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
COPY services/recipes/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy shared utilities
COPY shared/ ./shared/
# Copy application code
COPY app/ ./app/
COPY services/recipes/app/ ./app/
# Create logs directory
RUN mkdir -p logs

View File

@@ -8,6 +8,7 @@ python-multipart==0.0.6
# Database
sqlalchemy==2.0.23
psycopg2-binary==2.9.9
asyncpg==0.29.0
alembic==1.12.1
# Data validation