userbymahadi commited on
Commit
c106911
·
verified ·
1 Parent(s): 8635771

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -11
Dockerfile CHANGED
@@ -1,7 +1,6 @@
1
- # ベースイメージとして軽量なDebianを使用
2
  FROM python:3.9-slim-bullseye
3
 
4
- # 必要なツール(curl, git, sudoなど)をインストール
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
- # code-server(VSCodeのWeb版)をインストール
 
 
 
 
 
 
 
 
14
  RUN curl -fsSL https://code-server.dev/install.sh | sh
15
 
16
- # ユーザーを作成(セキュリティのためrootではなく一般ユーザーで動かします)
17
  RUN useradd -m -u 1000 user && \
18
  echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
19
 
20
- # Hugging Face Spaceはポート7860を使います
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 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"]