Spaces:
Sleeping
Sleeping
# Use an official Python runtime as a parent image | |
FROM python:3.9-slim | |
# Set the working directory in the container | |
WORKDIR /code | |
ENV HF_HOME=/code/.cache | |
# Copy the requirements.txt file into the container at /code | |
COPY requirements.txt /code/requirements.txt | |
# Install any dependencies specified in requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the Python script to download the model | |
COPY download_model.py /code/download_model.py | |
# Run the Python script to download the Florence-2-base-ft model and processor | |
RUN python /code/download_model.py | |
# Copy the current directory contents into the container at /code | |
COPY . . | |
# Copy the numberPlate_model_2 folder to /code/numberPlate_model_2 | |
COPY numberPlate_model_2 /code/numberPlate_model_2 | |
# Command to run the FastAPI app using Uvicorn with live-reload | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |