services: db: image: postgres:15-alpine environment: POSTGRES_USER: sentiment_user POSTGRES_PASSWORD: changeme POSTGRES_DB: sentiment_db ports: - "5432:5432" volumes: - db_data:/var/lib/postgresql/data - ./Database/schema.sql:/docker-entrypoint-initdb.d/01_schema.sql:ro restart: unless-stopped model-api: build: context: . dockerfile: Dockerfile image: sentiment-model-service:latest environment: DB_HOST: db DB_PORT: 5432 DB_NAME: sentiment_db DB_USER: sentiment_user DB_PASSWORD: changeme JWT_SECRET_KEY: ${JWT_SECRET_KEY:-CHANGE_ME_IN_PRODUCTION} JWT_ALGORITHM: ${JWT_ALGORITHM:-HS256} JWT_EXPIRE_MINUTES: ${JWT_EXPIRE_MINUTES:-60} MODEL_REFERENCE: ${MODEL_REFERENCE:-afriberta_small} TRANSFORMER_RUN_NAME: ${TRANSFORMER_RUN_NAME:-afriberta_small} ports: - "8000:8000" volumes: - ./models:/app/models:ro - ./reports:/app/reports depends_on: - db restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5).read()"] interval: 30s timeout: 10s retries: 3 start_period: 60s volumes: db_data: