Spaces:
Sleeping
Sleeping
acecalisto3
commited on
Commit
•
273bb6f
1
Parent(s):
79d819b
Update dockerfile.yml
Browse files- dockerfile.yml +15 -16
dockerfile.yml
CHANGED
@@ -1,23 +1,22 @@
|
|
1 |
-
|
2 |
-
FROM python:3.9-slim-buster
|
3 |
-
|
4 |
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
|
10 |
-
CMD ["python", "app.py"]
|
11 |
|
12 |
-
# Copy
|
13 |
-
COPY
|
14 |
-
RUN
|
15 |
-
|
16 |
-
# Copy the rest of the
|
17 |
COPY . .
|
18 |
|
19 |
-
# Expose the port
|
20 |
-
EXPOSE
|
|
|
|
|
|
|
21 |
|
22 |
-
#
|
23 |
-
|
|
|
1 |
+
FROM python:3.9-slim
|
|
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Install git and other dependencies
|
6 |
+
RUN apt-get update && apt-get install -y git curl
|
|
|
|
|
7 |
|
8 |
+
# Copy requirements first to leverage Docker cache
|
9 |
+
COPY requirements.txt .
|
10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
+
|
12 |
+
# Copy the rest of the application
|
13 |
COPY . .
|
14 |
|
15 |
+
# Expose the Streamlit port
|
16 |
+
EXPOSE 8501
|
17 |
+
|
18 |
+
# Health check to ensure the container is running properly
|
19 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 CMD curl -f http://localhost:8501/_stcore/health || exit 1
|
20 |
|
21 |
+
# Command to run the application
|
22 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.address", "0.0.0.0"]
|