Mrgf9993 commited on
Commit
7d78419
·
verified ·
1 Parent(s): ca2ba8b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -25
Dockerfile CHANGED
@@ -1,35 +1,36 @@
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 \
8
- sudo \
9
- sqlite3 \
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
+ # 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", "."]