Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +35 -0
Dockerfile
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a Python 3.9 slim image as the base
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory inside the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Update the package list and install necessary dependencies.
|
8 |
+
# I've removed 'software-properties-common' because it is not available in the slim image,
|
9 |
+
# and have kept 'libgl1' to fix the previous error.
|
10 |
+
RUN apt-get update && apt-get install -y \
|
11 |
+
build-essential \
|
12 |
+
curl \
|
13 |
+
git \
|
14 |
+
git-lfs \
|
15 |
+
ffmpeg \
|
16 |
+
libsm6 \
|
17 |
+
libxext6 \
|
18 |
+
cmake \
|
19 |
+
rsync \
|
20 |
+
libgl1 \
|
21 |
+
&& rm -rf /var/lib/apt/lists/*
|
22 |
+
|
23 |
+
# Copy the requirements file and install the Python dependencies
|
24 |
+
COPY requirements.txt ./
|
25 |
+
COPY src/ ./src/
|
26 |
+
RUN pip3 install -r requirements.txt
|
27 |
+
|
28 |
+
# Expose the port for the Streamlit application
|
29 |
+
EXPOSE 8501
|
30 |
+
|
31 |
+
# Add a health check to ensure the application is running
|
32 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
33 |
+
|
34 |
+
# Define the entry point to run the Streamlit application
|
35 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|