hareshchander's picture
Create Dockerfile
08fce02 verified
Raw History Blame Contribute Delete
893 Bytes
# ----- Base image -----
FROM python:3.11-slim
# ----- Set working directory -----
WORKDIR /home/user/app
# ----- Install system dependencies -----
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
libgl1-mesa-glx \
cmake \
rsync \
&& rm -rf /var/lib/apt/lists/*
# ----- Copy app files -----
COPY ./ /home/user/app
# ----- Upgrade pip and install Python dependencies -----
RUN python -m pip install --upgrade pip
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# ----- Streamlit config -----
RUN mkdir -p /home/user/.streamlit
COPY .streamlit/config.toml /home/user/.streamlit/config.toml
# ----- Expose port -----
EXPOSE 8501
# ----- Run the app -----
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.headless=true"]