Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -11
Dockerfile
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
-
# ベースイメージとして軽量なDebianを使用
|
| 2 |
FROM python:3.9-slim-bullseye
|
| 3 |
|
| 4 |
-
#
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
curl \
|
| 7 |
git \
|
|
@@ -10,26 +9,34 @@ RUN apt-get update && apt-get install -y \
|
|
| 10 |
build-essential \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 15 |
|
| 16 |
-
#
|
| 17 |
RUN useradd -m -u 1000 user && \
|
| 18 |
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
| 19 |
|
| 20 |
-
# Hugging Face Space
|
| 21 |
ENV PORT=7860
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
#
|
| 25 |
WORKDIR /home/user
|
| 26 |
|
| 27 |
-
#
|
| 28 |
COPY entrypoint.sh /entrypoint.sh
|
| 29 |
RUN chmod +x /entrypoint.sh
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
USER
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim-bullseye
|
| 2 |
|
| 3 |
+
# Install necessary tools (curl, git, sudo, etc.)
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
curl \
|
| 6 |
git \
|
|
|
|
| 9 |
build-essential \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Install Latest Current Node.js Version (v26.x) via NodeSource
|
| 13 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \
|
| 14 |
+
apt-get install -y nodejs
|
| 15 |
+
|
| 16 |
+
# Install latest npm and Gemini CLI globally
|
| 17 |
+
RUN npm install -g npm@latest && \
|
| 18 |
+
npm install -g @google/gemini-cli
|
| 19 |
+
|
| 20 |
+
# Install code-server (Web version of VSCode)
|
| 21 |
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 22 |
|
| 23 |
+
# Create a non-root user for security purposes
|
| 24 |
RUN useradd -m -u 1000 user && \
|
| 25 |
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
| 26 |
|
| 27 |
+
# Hugging Face Space uses port 7860
|
| 28 |
ENV PORT=7860
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
+
# Set working directory
|
| 32 |
WORKDIR /home/user
|
| 33 |
|
| 34 |
+
# Copy entrypoint script and grant execution permissions
|
| 35 |
COPY entrypoint.sh /entrypoint.sh
|
| 36 |
RUN chmod +x /entrypoint.sh
|
| 37 |
|
| 38 |
+
# Switch to non-root user
|
| 39 |
+
USER root
|
| 40 |
|
| 41 |
+
# Execution command
|
| 42 |
+
ENTRYPOINT ["/entrypoint.sh"]
|