Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +19 -33
Dockerfile
CHANGED
|
@@ -1,42 +1,28 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
-
FROM python:3.9
|
| 4 |
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
-
curl \
|
| 10 |
-
unzip \
|
| 11 |
-
git \
|
| 12 |
-
wget \
|
| 13 |
-
build-essential \
|
| 14 |
-
&& apt-get clean \
|
| 15 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
-
|
| 17 |
-
# Install code-server with specific version for consistency
|
| 18 |
RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.16.1
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
RUN
|
| 29 |
-
--install-extension ms-toolsai.jupyter \
|
| 30 |
-
--install-extension ms-vscode.vscode-json \
|
| 31 |
-
--install-extension ms-python.autopep8 \
|
| 32 |
-
--install-extension ms-python.flake8
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
COPY
|
| 36 |
-
RUN chmod +x /app/
|
| 37 |
|
| 38 |
-
#
|
| 39 |
EXPOSE 8080
|
| 40 |
-
|
| 41 |
-
# Use the startup script
|
| 42 |
-
CMD ["/app/start.sh"]
|
|
|
|
| 1 |
+
# Ultra-fast alternative using a pre-built base
|
| 2 |
+
FROM continuumio/miniconda3:latest
|
|
|
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Install code-server quickly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.16.1
|
| 8 |
|
| 9 |
+
# Use conda for faster package management
|
| 10 |
+
RUN conda install -c conda-forge -y \
|
| 11 |
+
pytorch torchvision torchaudio cpuonly \
|
| 12 |
+
transformers \
|
| 13 |
+
scikit-learn \
|
| 14 |
+
pandas \
|
| 15 |
+
jupyter \
|
| 16 |
+
matplotlib \
|
| 17 |
+
&& conda clean -a
|
| 18 |
|
| 19 |
+
# Quick pip installs for packages not in conda
|
| 20 |
+
RUN pip install --no-cache-dir datasets streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# Install extensions in background during startup
|
| 23 |
+
COPY install-extensions.sh /app/
|
| 24 |
+
RUN chmod +x /app/install-extensions.sh
|
| 25 |
|
| 26 |
+
# Minimal startup
|
| 27 |
EXPOSE 8080
|
| 28 |
+
CMD ["bash", "-c", "/app/install-extensions.sh & code-server --bind-addr 0.0.0.0:8080 --auth none /app"]
|
|
|
|
|
|