cog / Dockerfile
mattritchey's picture
Create Dockerfile
56d0c88 verified
raw
history blame
529 Bytes
FROM python:3.9-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
gdal-bin \
libgdal-dev \
&& rm -rf /var/lib/apt/lists/*
# Set up environment variables
ENV PYTHONUNBUFFERED=1
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create a directory for the GeoTIFFs
RUN mkdir -p /data/cogs
# Copy the app code
COPY app.py .
# Expose port 7860 (default for Hugging Face Spaces)
EXPOSE 7860
# Start the app
CMD ["python", "app.py"]