Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +35 -0
Dockerfile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ----- Base image -----
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# ----- Set working directory -----
|
| 5 |
+
WORKDIR /home/user/app
|
| 6 |
+
|
| 7 |
+
# ----- Install system dependencies -----
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
git \
|
| 10 |
+
git-lfs \
|
| 11 |
+
ffmpeg \
|
| 12 |
+
libsm6 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
libgl1-mesa-glx \
|
| 15 |
+
cmake \
|
| 16 |
+
rsync \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
+
|
| 19 |
+
# ----- Copy app files -----
|
| 20 |
+
COPY ./ /home/user/app
|
| 21 |
+
|
| 22 |
+
# ----- Upgrade pip and install Python dependencies -----
|
| 23 |
+
RUN python -m pip install --upgrade pip
|
| 24 |
+
COPY requirements.txt /tmp/requirements.txt
|
| 25 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 26 |
+
|
| 27 |
+
# ----- Streamlit config -----
|
| 28 |
+
RUN mkdir -p /home/user/.streamlit
|
| 29 |
+
COPY .streamlit/config.toml /home/user/.streamlit/config.toml
|
| 30 |
+
|
| 31 |
+
# ----- Expose port -----
|
| 32 |
+
EXPOSE 8501
|
| 33 |
+
|
| 34 |
+
# ----- Run the app -----
|
| 35 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.headless=true"]
|