Add POS service

This commit is contained in:
Urtzi Alfaro
2025-08-16 15:00:36 +02:00
parent 995a51e285
commit 23c5f50111
34 changed files with 6086 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ volumes:
inventory_db_data:
recipes_db_data:
suppliers_db_data:
pos_db_data:
redis_data:
rabbitmq_data:
prometheus_data:
@@ -305,6 +306,27 @@ services:
timeout: 5s
retries: 5
pos-db:
image: postgres:15-alpine
container_name: bakery-pos-db
restart: unless-stopped
environment:
- POSTGRES_DB=${POS_DB_NAME}
- POSTGRES_USER=${POS_DB_USER}
- POSTGRES_PASSWORD=${POS_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- pos_db_data:/var/lib/postgresql/data
networks:
bakery-network:
ipv4_address: 172.20.0.31
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POS_DB_USER} -d ${POS_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
# ================================================================
# LOCATION SERVICES (NEW SECTION)
@@ -774,6 +796,43 @@ services:
timeout: 10s
retries: 3
pos-service:
build:
context: .
dockerfile: ./services/pos/Dockerfile
args:
- ENVIRONMENT=${ENVIRONMENT}
- BUILD_DATE=${BUILD_DATE}
image: bakery/pos-service:${IMAGE_TAG}
container_name: bakery-pos-service
restart: unless-stopped
env_file: .env
ports:
- "${POS_SERVICE_PORT}:8000"
depends_on:
pos-db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
auth-service:
condition: service_healthy
sales-service:
condition: service_healthy
networks:
bakery-network:
ipv4_address: 172.20.0.112
volumes:
- log_storage:/app/logs
- ./services/pos:/app
- ./shared:/app/shared
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# ================================================================
# MONITORING - SIMPLE APPROACH
# ================================================================