Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -8
Dockerfile
CHANGED
|
@@ -1,27 +1,25 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# 1. Install
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
| 9 |
-
software-properties-common \
|
| 10 |
git \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# 2. Copy
|
| 14 |
COPY requirements.txt .
|
| 15 |
-
|
| 16 |
-
# 3. Install the libraries
|
| 17 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
#
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
#
|
| 23 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 24 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 25 |
|
| 26 |
-
#
|
| 27 |
CMD ["streamlit", "run", "streamlit_app.py"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Set the working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# 1. Install ONLY the absolute necessities
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
|
|
|
| 10 |
git \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# 2. Copy and install requirements
|
| 14 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 15 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
# 3. Copy the rest of the code
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
+
# 4. Streamlit environment variables
|
| 21 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 22 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 23 |
|
| 24 |
+
# 5. Launch
|
| 25 |
CMD ["streamlit", "run", "streamlit_app.py"]
|