our-era / Dockerfile
msradam's picture
Fix: enable CORS for iframe embedding
ed9e26a
Raw
History Blame Contribute Delete
1.16 kB
# OUR-ERA: Hugging Face Spaces Deployment
# Includes Ollama + Streamlit in a single container
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
zstd \
libgdal-dev \
libgeos-dev \
libproj-dev \
gdal-bin \
&& rm -rf /var/lib/apt/lists/*
# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh
# Set GDAL environment variables
ENV GDAL_CONFIG=/usr/bin/gdal-config
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
COPY core/ ./core/
COPY data/ ./data/
# Copy startup script
COPY start.sh .
RUN chmod +x start.sh
# Hugging Face Spaces expects port 7860
EXPOSE 7860
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_ENABLE_CORS=false
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
ENV OLLAMA_HOST=http://localhost:11434
# Start both Ollama and Streamlit
CMD ["./start.sh"]