Spaces:
Sleeping
Sleeping
# Use an official Python runtime as a parent image | |
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 \ | |
libpq-dev \ | |
gcc \ | |
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 local files to the container | |
COPY . . | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade pip \ | |
&& pip install --no-cache-dir -r requirements.txt | |
# Expose the port Streamlit will run on | |
EXPOSE 8501 | |
# Run Streamlit | |
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"] | |