habppyar commited on
Commit
e0bf8e5
·
verified ·
1 Parent(s): 03e2755

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -20
Dockerfile CHANGED
@@ -1,26 +1,18 @@
1
- FROM node:20-slim
2
 
3
- # basic tools + tini for clean signal handling
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ca-certificates curl bash git tini \
6
- && rm -rf /var/lib/apt/lists/*
7
 
8
- # Create non-root user (recommended in Spaces)
9
- RUN useradd -m -u 1000 user
10
-
11
- # Install OpenCode (Node method is officially supported)
12
- RUN npm install -g opencode-ai
13
-
14
- # Install HF CLI (standalone installer)
15
- # Official CLI docs: curl -LsSf https://hf.co/cli/install.sh | bash
16
- RUN curl -LsSf https://hf.co/cli/install.sh | bash
17
-
18
- USER user
19
- ENV HOME=/home/user
20
- ENV PATH="/home/user/.local/bin:/usr/local/bin:${PATH}"
21
 
22
  WORKDIR /app
23
- COPY --chown=user:user . /app
 
 
 
24
 
25
- ENTRYPOINT ["/usr/bin/tini","--"]
26
- CMD ["/app/entrypoint.sh"]
 
1
+ FROM debian:bookworm-slim
2
 
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ ca-certificates curl tar \
5
+ && rm -rf /var/lib/apt/lists/*
6
 
7
+ # Install OpenCode binary from GitHub Releases (latest)
8
+ RUN curl -L https://github.com/opencode-ai/opencode/releases/latest/download/opencode-linux-x86_64.tar.gz \
9
+ | tar -xz -C /usr/local/bin opencode
 
 
 
 
 
 
 
 
 
 
10
 
11
  WORKDIR /app
12
+ COPY . /app
13
+
14
+ ENV OPENCODE_CONFIG=/app/config/opencode.jsonc
15
+ ENV OPENCODE_CONFIG_DIR=/app/config
16
 
17
+ EXPOSE 7860
18
+ CMD ["opencode", "web", "--hostname", "0.0.0.0", "--port", "7860"]