services: api: build: . container_name: nlp_api command: uvicorn api.main:app --host 0.0.0.0 --port 8000 ports: - "8000:8000" environment: - MODEL_NAME=distilbert/distilbert-base-uncased-finetuned-sst-2-english - IRONY_MODEL_REPO=jorgeasmz/distilbert-irony-tweeteval volumes: # Must match HF_HOME in the Dockerfile, or the cache silently lands # somewhere the library never reads and the model re-downloads on every # start. - ./model_cache:/app/.cache healthcheck: test: ["CMD-SHELL", "python -c \"import urllib.request,json; assert json.load(urllib.request.urlopen('http://localhost:8000/'))['model_ready']\""] interval: 10s timeout: 5s retries: 10 start_period: 60s web: build: . container_name: nlp_web command: streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 ports: - "8501:8501" environment: - API_URL=http://api:8000 depends_on: api: condition: service_healthy