# Use an official Python runtime as a parent image FROM python:3.9-slim # Install system dependencies RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Create the configuration directory RUN mkdir -p /deforestation_percentage_image_api/.config/sentinelhub # Change ownership of the configuration directory # RUN chown -R arsh1101:arsh1101 /deforestation_percentage_image_api/.config # Ensure the user has ownership of the config directory # Set the working directory in the container WORKDIR /deforestation_percentage_image_api # Copy the requirements.txt into the container COPY requirements.txt ./requirements.txt # Install any dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container COPY . . # Expose the port FastAPI runs on EXPOSE 8000 # Command to run the FastAPI app using Uvicorn CMD ["uvicorn", "deforestation_percenatge_image_api:app", "--host", "0.0.0.0", "--port", "8000"]