| # Use the official code-server image | |
| FROM codercom/code-server:latest | |
| # Switch to root to install additional packages if needed | |
| USER root | |
| # Optional: Install Python, Node.js, or other tools you need | |
| RUN apt-get update && apt-get install -y \ | |
| python3 \ | |
| python3-pip \ | |
| git \ | |
| curl | |
| # Switch back to the 'coder' user for security | |
| USER coder | |
| # Expose port 7860 (Hugging Face's default port) | |
| EXPOSE 7860 | |
| # Start code-server | |
| # We bind to 0.0.0.0 to allow external access | |
| # We point the user data directory to /home/coder to ensure permissions are correct | |
| ENTRYPOINT ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "password", "."] |