Update Dockerfile
Browse files- Dockerfile +23 -13
Dockerfile
CHANGED
|
@@ -1,22 +1,32 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
-
#
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
-
ttyd \
|
| 6 |
-
bash \
|
| 7 |
curl \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
#
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
-
# interactively even after 'opencode' finishes executing.
|
| 22 |
-
CMD ["ttyd", "-p", "7860", "bash", "-c", "opencode; bash"]
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
+
# Prevent interactive prompts during installation
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Install core dependencies, Node.js (via NodeSource for v18+ support), and ttyd
|
| 7 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
| 8 |
curl \
|
| 9 |
+
git \
|
| 10 |
+
python3 \
|
| 11 |
+
python3-pip \
|
| 12 |
+
build-essential \
|
| 13 |
+
ttyd \
|
| 14 |
+
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
| 15 |
+
&& apt-get install -y nodejs \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
+
# 1. Install OpenCode globally via its official Node package manager registry
|
| 19 |
+
RUN npm install -g opencode-ai
|
| 20 |
+
|
| 21 |
+
# 2. Verify that npm registered the command globally (This creates /usr/bin/opencode or /usr/local/bin/opencode)
|
| 22 |
+
RUN opencode --version
|
| 23 |
+
|
| 24 |
+
# Create a project workspace directory
|
| 25 |
+
WORKDIR /workspace
|
| 26 |
|
| 27 |
+
# Hugging Face Spaces run on port 7860
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Expose OpenCode globally over the web terminal interface
|
| 31 |
+
# ttyd will call 'opencode' safely out of npm's globally registered bin PATH
|
| 32 |
+
CMD ["ttyd", "-p", "7860", "-W", "bash", "-c", "opencode"]
|
|
|
|
|
|