chatbot-frontend / Dockerfile
tech5's picture
Fix Streamlit Docker permission issue
57ead86
raw
history blame contribute delete
646 Bytes
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Copy everything
COPY . /app
# Install requirements
RUN pip install --upgrade pip && pip install -r requirements.txt
# Create .streamlit config with safe permissions
RUN mkdir -p /app/.streamlit && \
chmod -R 777 /app/.streamlit && \
echo "\
[server]\n\
headless = true\n\
port = 7860\n\
enableCORS = false\n\
enableXsrfProtection = false\n\
\n\
[browser]\n\
gatherUsageStats = false\n\
" > /app/.streamlit/config.toml
# Expose the port Streamlit runs on
EXPOSE 7860
# Run Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]