# Stage 1: Build stage FROM python:3.10 # Set the working directory in the container WORKDIR /app # Change permissions to allow all users to write to the /app directory RUN chmod 777 /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ libpq-dev \ gdal-bin \ libgdal-dev \ python3-gdal \ && rm -rf /var/lib/apt/lists/* # Set environment variables for GDAL ENV GDAL_CONFIG=/usr/bin/gdal-config ENV CPLUS_INCLUDE_PATH=/usr/include/gdal ENV C_INCLUDE_PATH=/usr/include/gdal # Copy the requirements file into the container COPY . . # Install Python dependencies RUN pip install --no-cache-dir --upgrade pip \ && pip install --no-cache-dir -r requirements.txt # Expose port 8501 for Streamlit EXPOSE 8501 # Command to run the Streamlit app CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]