|
|
|
FROM python:3.10 |
|
|
|
|
|
RUN apt-get update && apt-get install -y openjdk-17-jre-headless |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \ |
|
PATH="$JAVA_HOME/bin:$PATH" \ |
|
STREAMLIT_SERVER_PORT=7860 \ |
|
STREAMLIT_SERVER_ADDRESS=0.0.0.0 |
|
|
|
|
|
RUN useradd -m -s /bin/bash streamlit |
|
|
|
|
|
RUN mkdir -p /app /app/saved_models /app/.streamlit \ |
|
&& chown -R streamlit:streamlit /app |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN echo '[server]' > /app/.streamlit/config.toml \ |
|
&& echo 'maxUploadSize = 200' >> /app/.streamlit/config.toml \ |
|
&& echo 'enableXsrfProtection = false' >> /app/.streamlit/config.toml |
|
|
|
|
|
RUN chmod -R 755 /app \ |
|
&& chmod -R 777 /app/saved_models \ |
|
&& chown -R streamlit:streamlit /app |
|
|
|
|
|
USER streamlit |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["streamlit", "run", "--server.enableXsrfProtection=false", "app.py"] |