Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +7 -15
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
@@ -17,19 +16,12 @@ RUN apt-get update && apt-get install -y \
|
|
| 17 |
EXPOSE 7860
|
| 18 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
git fetch --all && \
|
| 24 |
-
git reset --hard origin/main && \
|
| 25 |
-
git lfs pull; \
|
| 26 |
-
else \
|
| 27 |
-
echo "Cartella vuota, clono il repository..." && \
|
| 28 |
-
git clone https://$GITHUB_TOKEN@github.com/Elyon7/Cosmo-Edu_Lab.git . && \
|
| 29 |
-
git lfs pull; \
|
| 30 |
-
fi && \
|
| 31 |
mkdir -p App/student_submissions && \
|
| 32 |
chmod 777 App/student_submissions && \
|
| 33 |
-
pip install --no-cache-dir -r requirements.txt
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
| 16 |
EXPOSE 7860
|
| 17 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 18 |
|
| 19 |
+
# Cloniamo e installiamo ora, così all'avvio l'app è pronta in 1 secondo
|
| 20 |
+
RUN git clone https://$GITHUB_TOKEN@github.com/Elyon7/Cosmo-Edu_Lab.git . && \
|
| 21 |
+
git lfs pull && \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
mkdir -p App/student_submissions && \
|
| 23 |
chmod 777 App/student_submissions && \
|
| 24 |
+
pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# Avvio immediato (senza più download)
|
| 27 |
+
CMD ["python", "-u", "App/main.py"]
|