Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +12 -4
Dockerfile
CHANGED
|
@@ -1,16 +1,23 @@
|
|
| 1 |
# Use a standard, full-featured base image that's great for development tools
|
| 2 |
FROM node:20
|
| 3 |
|
| 4 |
-
# --- Install Dependencies (as root)
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
git \
|
| 8 |
curl \
|
| 9 |
python3 \
|
| 10 |
python3-pip \
|
| 11 |
-
python3-uv \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# --- Install Gemini CLI (as root) ---
|
| 15 |
RUN npm install -g @google/gemini-cli
|
| 16 |
|
|
@@ -26,8 +33,9 @@ WORKDIR /home/node
|
|
| 26 |
# Now, permanently switch to the non-root user
|
| 27 |
USER node
|
| 28 |
|
| 29 |
-
# Expose the port that code-server will run on
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
# --- Final Command (as the 'node' user) ---
|
|
|
|
| 33 |
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."]
|
|
|
|
| 1 |
# Use a standard, full-featured base image that's great for development tools
|
| 2 |
FROM node:20
|
| 3 |
|
| 4 |
+
# --- Install Dependencies (as root) ---
|
| 5 |
+
# We remove python3-uv from this list as it's not available in the apt repo
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
git \
|
| 8 |
curl \
|
| 9 |
python3 \
|
| 10 |
python3-pip \
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# --- Install uv (as root) and move it to a global location ---
|
| 14 |
+
# This is the correct and reliable way to install uv.
|
| 15 |
+
# 1. Download and run the official installer script.
|
| 16 |
+
# 2. Move the compiled 'uv' program to /usr/local/bin.
|
| 17 |
+
# This makes it available to ALL users, including the 'node' user.
|
| 18 |
+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 19 |
+
mv /root/.cargo/bin/uv /usr/local/bin/uv
|
| 20 |
+
|
| 21 |
# --- Install Gemini CLI (as root) ---
|
| 22 |
RUN npm install -g @google/gemini-cli
|
| 23 |
|
|
|
|
| 33 |
# Now, permanently switch to the non-root user
|
| 34 |
USER node
|
| 35 |
|
| 36 |
+
# Expose the port that code-server will run on. Hugging Face will detect this.
|
| 37 |
EXPOSE 7860
|
| 38 |
|
| 39 |
# --- Final Command (as the 'node' user) ---
|
| 40 |
+
# Start code-server directly.
|
| 41 |
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."]
|