Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
|
@@ -7,24 +7,24 @@ WORKDIR /app
|
|
| 7 |
# Install necessary dependencies
|
| 8 |
RUN apt-get update && apt-get install -y git
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# Set Matplotlib configuration directory
|
| 11 |
ENV MPLCONFIGDIR=/tmp/.matplotlib
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
# Create Matplotlib configuration directory
|
| 17 |
-
RUN mkdir -p /tmp/.matplotlib && chmod -R 777 /tmp/.matplotlib
|
| 18 |
|
| 19 |
# Clone private repository using mounted secret
|
| 20 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 21 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/sci_random_forest_classify.git .
|
| 22 |
|
| 23 |
# Install Python dependencies
|
| 24 |
-
RUN pip install -r requirements.txt
|
| 25 |
-
|
| 26 |
|
|
|
|
| 27 |
EXPOSE 7860
|
| 28 |
-
#CMD ["streamlit", "run", "app.py", "--server.port=7860"]
|
| 29 |
|
|
|
|
| 30 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
|
|
|
| 7 |
# Install necessary dependencies
|
| 8 |
RUN apt-get update && apt-get install -y git
|
| 9 |
|
| 10 |
+
# Upgrade pip to the latest version
|
| 11 |
+
RUN pip install --upgrade pip
|
| 12 |
+
|
| 13 |
# Set Matplotlib configuration directory
|
| 14 |
ENV MPLCONFIGDIR=/tmp/.matplotlib
|
| 15 |
|
| 16 |
+
# Create necessary directories and set permissions
|
| 17 |
+
RUN mkdir -p /app /tmp/.matplotlib && chmod -R 777 /app /tmp/.matplotlib
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Clone private repository using mounted secret
|
| 20 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 21 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/sci_random_forest_classify.git .
|
| 22 |
|
| 23 |
# Install Python dependencies
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 25 |
|
| 26 |
+
# Expose the port for Streamlit
|
| 27 |
EXPOSE 7860
|
|
|
|
| 28 |
|
| 29 |
+
# Run the Streamlit app
|
| 30 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|