Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -14
Dockerfile
CHANGED
|
@@ -1,27 +1,27 @@
|
|
| 1 |
# syntax=docker/dockerfile:1.4
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update && apt-get install -y git
|
| 6 |
-
|
| 7 |
-
# 设置工作目录
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
# 克隆私有仓库
|
| 14 |
-
RUN git clone https://x-access-token:${GITHUB_TOKEN}@github.com/leoncool23/sci_xg_classify.git .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
ENV MPLCONFIGDIR=/tmp/.matplotlib
|
|
|
|
|
|
|
| 18 |
RUN mkdir -p /tmp/.matplotlib && chmod -R 777 /tmp/.matplotlib
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
EXPOSE 8051
|
| 25 |
|
| 26 |
-
#
|
| 27 |
CMD ["streamlit", "run", "app.py", "--server.port=8051", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]
|
|
|
|
| 1 |
# syntax=docker/dockerfile:1.4
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set working directory
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 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 |
+
# Create Matplotlib configuration directory
|
| 14 |
RUN mkdir -p /tmp/.matplotlib && chmod -R 777 /tmp/.matplotlib
|
| 15 |
|
| 16 |
+
# Clone private repository using mounted secret
|
| 17 |
+
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 18 |
+
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/sci_xg_classify.git .
|
| 19 |
+
|
| 20 |
+
# Install Python dependencies
|
| 21 |
+
RUN pip install -r requirements.txt
|
| 22 |
|
| 23 |
+
# Expose the port Streamlit will run on
|
| 24 |
EXPOSE 8051
|
| 25 |
|
| 26 |
+
# Start Streamlit app with appropriate server settings
|
| 27 |
CMD ["streamlit", "run", "app.py", "--server.port=8051", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]
|