FROM python:3.9 # Set working directory WORKDIR /code # Copy requirements file and install dependencies COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Set environment variable for Transformers cache ENV HF_HOME=/tmp/transformers_cache COPY ./caption_server.py /code/caption_server.py # Copy the rest of the application code COPY . . # Command to run your application CMD ["uvicorn", "caption_server:app", "--reload", "--host", "0.0.0.0", "--port", "7860"]