bk939448 commited on
Commit
61baa6f
·
verified ·
1 Parent(s): 0fe8232

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +52 -0
Dockerfile ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Node.js stable version
2
+ FROM node:18-slim
3
+
4
+
5
+ # 2. Install required system tools & HF CLI
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ bash \
9
+ git \
10
+ python3 \
11
+ python3-pip \
12
+ python3.11-venv \
13
+ build-essential \
14
+ gcc \
15
+ g++ \
16
+ make \
17
+ nano \
18
+ zip \
19
+ unzip \
20
+ procps \
21
+ && curl -LsSf https://hf.co/cli/install.sh | bash \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+
25
+ # 3. Install OpenCode
26
+ RUN curl -fsSL https://opencode.ai/install | bash
27
+
28
+
29
+ # 4. Setup data folder and root permissions
30
+ USER root
31
+ RUN mkdir -p /data && chmod 777 /data
32
+ WORKDIR /data
33
+
34
+
35
+ # 5. Copy entrypoint script
36
+ COPY entrypoint.sh /entrypoint.sh
37
+ RUN chmod +x /entrypoint.sh
38
+
39
+
40
+ # 6. Environment settings with RAM limit
41
+ ENV OPENCODE_DATA_DIR=/data
42
+ ENV HOME=/data
43
+ ENV PATH="/root/.local/bin:/home/node/.local/bin:$PATH"
44
+ ENV NODE_OPTIONS="--max-old-space-size=14336"
45
+
46
+
47
+ # 7. Expose port 7860
48
+ EXPOSE 7860
49
+
50
+
51
+ # 8. Run entrypoint script
52
+ CMD ["/entrypoint.sh"]