Implement unified Oracle mode support with auto-detection

- Unified Dockerfile with thick/thin mode auto-detection
- Single docker-compose.yaml with build arguments
- Auto-detect logic: thick mode for Oracle 10g/11g, thin mode for 12.1+
- Simplified .env configuration with clear mode selection
- Updated admin.py with FORCE_THIN_MODE and INSTANTCLIENTPATH support
- Added comprehensive documentation for both deployment modes
- Container tested successfully with thick mode for Oracle 11g compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-09 11:44:31 +03:00
parent 3f654cd771
commit 4da36593da
7 changed files with 234 additions and 102 deletions

View File

@@ -1,27 +1,30 @@
version: '3.8'
# UNIFIED Docker Compose - AUTO-DETECT Oracle Mode
#
# Configurare prin .env:
# - Oracle 10g/11g: setează INSTANTCLIENTPATH=/opt/oracle/instantclient_23_9
# - Oracle 12.1+: setează FORCE_THIN_MODE=true (sau elimină INSTANTCLIENTPATH)
#
# Build modes:
# - docker-compose up --build → thick mode (default)
# - docker-compose up --build --build-arg ORACLE_MODE=thin → thin mode
services:
# Main Flask Application for Web Admin Interface
gomag_admin:
build:
context: ./api
dockerfile: Dockerfile
args:
# thick = Oracle 10g/11g/12.1+ (cu Instant Client)
# thin = Oracle 12.1+ only (fără Instant Client)
ORACLE_MODE: ${ORACLE_MODE:-thick}
container_name: gomag-admin
ports:
- "5003:5000" # Unique port for this project
- "5003:5000"
volumes:
- ./api:/app
- ./logs:/app/logs # Shared logging directory
environment:
- PYTHONUNBUFFERED=1
- FLASK_ENV=development
- FLASK_DEBUG=1
# Oracle connection settings - same as ROA server
- ORACLE_USER=CONTAFIN_ORACLE
- ORACLE_PASSWORD=ROMFASTSOFT
- ORACLE_DSN=ROA_ROMFAST
- TNS_ADMIN=/app
- INSTANTCLIENTPATH=/opt/oracle/instantclient_21_1
- ./logs:/app/logs
env_file:
- ./api/.env
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
@@ -29,12 +32,6 @@ services:
timeout: 10s
retries: 3
# Shared network for inter-container communication
networks:
default:
driver: bridge
# Persistent volumes
volumes:
logs_data:
driver: local
driver: bridge