# Use a lightweight Python base image FROM python:3.11-slim # Prevent Python from writing pyc files to disc and buffering stdout/stderr ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set the working directory WORKDIR /app # Install system dependencies (useful for spatial libraries) RUN apt-get update && apt-get install -y --no-install-recommends \ curl libexpat1\ && rm -rf /var/lib/apt/lists/* # Install Titiler and Uvicorn server RUN pip install --no-cache-dir titiler.application uvicorn COPY . . # Expose the requested port EXPOSE 7860 # Copy the entrypoint script into the container COPY entrypoint.sh /app/entrypoint.sh # Ensure the entrypoint script is executable RUN chmod +x /app/entrypoint.sh # Set the entrypoint to run the service ENTRYPOINT ["/app/entrypoint.sh"]