Add more services

This commit is contained in:
Urtzi Alfaro
2025-08-21 20:28:14 +02:00
parent d6fd53e461
commit c6dd6fd1de
85 changed files with 17842 additions and 1828 deletions

View File

@@ -26,6 +26,8 @@ volumes:
recipes_db_data:
suppliers_db_data:
pos_db_data:
orders_db_data:
production_db_data:
redis_data:
rabbitmq_data:
prometheus_data:
@@ -327,6 +329,48 @@ services:
timeout: 5s
retries: 5
orders-db:
image: postgres:15-alpine
container_name: bakery-orders-db
restart: unless-stopped
environment:
- POSTGRES_DB=${ORDERS_DB_NAME}
- POSTGRES_USER=${ORDERS_DB_USER}
- POSTGRES_PASSWORD=${ORDERS_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- orders_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.32
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${ORDERS_DB_USER} -d ${ORDERS_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
production-db:
image: postgres:15-alpine
container_name: bakery-production-db
restart: unless-stopped
environment:
- POSTGRES_DB=${PRODUCTION_DB_NAME}
- POSTGRES_USER=${PRODUCTION_DB_USER}
- POSTGRES_PASSWORD=${PRODUCTION_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- production_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.33
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PRODUCTION_DB_USER} -d ${PRODUCTION_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# ================================================================
# LOCATION SERVICES (NEW SECTION)
@@ -833,6 +877,84 @@ services:
timeout: 10s
retries: 3
orders-service:
build:
context: .
dockerfile: ./services/orders/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/orders-service:${IMAGE_TAG}
container_name: bakery-orders-service
restart: unless-stopped
env_file: .env
ports:
- "${ORDERS_SERVICE_PORT}:8000"
depends_on:
orders-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
inventory-service:
condition: service_healthy
suppliers-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.113
volumes:
- log_storage:/app/logs
- ./services/orders:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
production-service:
build:
context: .
dockerfile: ./services/production/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/production-service:${IMAGE_TAG}
container_name: bakery-production-service
restart: unless-stopped
env_file: .env
ports:
- "${PRODUCTION_SERVICE_PORT}:8000"
depends_on:
production-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
inventory-service:
condition: service_healthy
recipes-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.114
volumes:
- log_storage:/app/logs
- ./services/production:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# ================================================================
# MONITORING - SIMPLE APPROACH
# ================================================================