Spaces:
Sleeping
Sleeping
Download Dockerfile from nao80/code-server: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/nao80/code-server/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/nao80/code-server/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/nao80/code-server/resolve/main/Dockerfile
1.01 kB
| FROM python:3.10-slim | |
| ENV USER_ID=1000 | |
| ENV HOME=/home/user | |
| ENV PATH=$HOME/.local/bin:$PATH | |
| # AWS CLIとcode-serverの依存関係をインストール | |
| RUN apt-get update && apt-get install -y \ | |
| curl git sudo unzip \ | |
| && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | |
| && unzip awscliv2.zip && ./aws/install \ | |
| && rm -rf awscliv2.zip ./aws \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # code-serverインストール | |
| RUN curl -fsSL https://code-server.dev/install.sh | sh | |
| # UID 1000のユーザーを作成 | |
| RUN useradd -m -u $USER_ID user | |
| # 修正ポイント: 必要なディレクトリを事前に作成し、権限を付与 | |
| RUN mkdir -p /home/user/.config /home/user/.local /home/user/app/workspace && \ | |
| chown -R user:user /home/user | |
| USER user | |
| WORKDIR /home/user/app | |
| # 同期スクリプトをコピー | |
| COPY --chown=user:user entrypoint.sh /home/user/entrypoint.sh | |
| RUN chmod +x /home/user/entrypoint.sh | |
| EXPOSE 7860 | |
| ENTRYPOINT ["/home/user/entrypoint.sh"] |