Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +26 -25
Dockerfile
CHANGED
|
@@ -1,35 +1,36 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
curl \
|
| 7 |
-
git \
|
| 8 |
-
sudo \
|
| 9 |
-
sqlite3 \
|
| 10 |
-
build-essential \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# code-server
|
| 14 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
RUN
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
# Hugging Face Spaceはポート7860を使います
|
| 21 |
-
ENV PORT=7860
|
| 22 |
-
EXPOSE 7860
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
COPY
|
| 29 |
-
RUN
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a lightweight Ubuntu base
|
| 2 |
+
FROM ubuntu:22.04
|
| 3 |
|
| 4 |
+
# Avoid prompts from apt
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# 1. Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
+
curl git unzip xz-utils zip libglu1-mesa python3 python3-pip wget \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# 2. Install VS Code Server (code-server)
|
| 13 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 14 |
|
| 15 |
+
# 3. Install Flutter SDK
|
| 16 |
+
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
|
| 17 |
+
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"
|
| 18 |
+
RUN flutter doctor
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
# 4. Set up a non-root user (Required by Hugging Face)
|
| 21 |
+
RUN useradd -m -u 1000 user
|
| 22 |
+
USER user
|
| 23 |
+
ENV HOME=/home/user
|
| 24 |
+
WORKDIR $HOME
|
| 25 |
|
| 26 |
+
# 5. Install Python dependencies
|
| 27 |
+
COPY --chown=user requirements.txt .
|
| 28 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 29 |
|
| 30 |
+
# 6. Expose the port Hugging Face expects
|
| 31 |
+
EXPOSE 7860
|
| 32 |
|
| 33 |
+
# 7. Start code-server
|
| 34 |
+
# --auth none: No password (protected by HF's own auth)
|
| 35 |
+
# --bind-addr: Listen on port 7860
|
| 36 |
+
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."]
|