MD Mahadi commited on
Commit
a25adf1
·
verified ·
1 Parent(s): 4462b60

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -36
Dockerfile CHANGED
@@ -1,42 +1,17 @@
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 \
7
- sudo \
8
- sqlite3 \
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 user
40
-
41
- # Execution command
42
- ENTRYPOINT ["/entrypoint.sh"]
 
1
+ # Use lightweight Node.js base image
2
+ FROM node:22-slim
3
 
4
+ # Install git, curl, and bash
5
+ RUN apt-get update && apt-get install -y git curl bash && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
6
 
7
+ # Install OpenCode CLI globally
8
+ RUN npm install -g opencode-ai
 
9
 
10
+ # Create workspace directory
11
+ WORKDIR /workspace
 
12
 
13
+ # Hugging Face default port is 7860
 
 
 
 
 
 
 
 
14
  EXPOSE 7860
15
 
16
+ # Start OpenCode web server bound to 0.0.0.0 and port 7860
17
+ CMD ["sh", "-c", "opencode web --hostname 0.0.0.0 --port 7860"]