Update Dockerfile
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
|
@@ -1,32 +1,38 @@
|
|
| 1 |
FROM node:20-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 4 |
ca-certificates \
|
| 5 |
-
git \
|
| 6 |
bash \
|
| 7 |
tini \
|
|
|
|
| 8 |
rsync \
|
| 9 |
sqlite3 \
|
|
|
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
RUN npm install -g opencode-ai
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
RUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-open
|
| 17 |
|
| 18 |
WORKDIR /home/node
|
| 19 |
-
|
| 20 |
COPY --chown=node:node start.sh /home/node/start.sh
|
| 21 |
COPY --chown=node:node opencode.json.example /home/node/opencode.json.example
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN sed -i 's/\r$//' /home/node/start.sh
|
| 25 |
-
|
| 26 |
-
RUN chmod +x /home/node/start.sh
|
| 27 |
|
| 28 |
USER node
|
| 29 |
-
EXPOSE 7860
|
| 30 |
|
|
|
|
| 31 |
ENTRYPOINT ["/usr/bin/tini", "--"]
|
| 32 |
CMD ["/home/node/start.sh"]
|
|
|
|
| 1 |
FROM node:20-slim
|
| 2 |
|
| 3 |
+
# System deps:
|
| 4 |
+
# - sqlite3: for consistent .backup
|
| 5 |
+
# - python3/pip: to install hf CLI (huggingface_hub)
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
ca-certificates \
|
|
|
|
| 8 |
bash \
|
| 9 |
tini \
|
| 10 |
+
git \
|
| 11 |
rsync \
|
| 12 |
sqlite3 \
|
| 13 |
+
python3 \
|
| 14 |
+
python3-pip \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Install OpenCode
|
|
|
|
| 18 |
RUN npm install -g opencode-ai
|
| 19 |
|
| 20 |
+
# Install Hugging Face CLI (`hf`) via huggingface_hub
|
| 21 |
+
# The CLI includes `hf buckets cp` / `hf buckets sync` etc.
|
| 22 |
+
RUN pip3 install --no-cache-dir -U "huggingface_hub[cli]"
|
| 23 |
+
|
| 24 |
+
# No-op xdg-open shim (opencode web tries to open browser; container is headless)
|
| 25 |
RUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-open
|
| 26 |
|
| 27 |
WORKDIR /home/node
|
|
|
|
| 28 |
COPY --chown=node:node start.sh /home/node/start.sh
|
| 29 |
COPY --chown=node:node opencode.json.example /home/node/opencode.json.example
|
| 30 |
|
| 31 |
+
# CRLF保险(即使网页编辑理论上是LF,这条也无害)
|
| 32 |
+
RUN sed -i 's/\r$//' /home/node/start.sh && chmod +x /home/node/start.sh
|
|
|
|
|
|
|
| 33 |
|
| 34 |
USER node
|
|
|
|
| 35 |
|
| 36 |
+
EXPOSE 7860
|
| 37 |
ENTRYPOINT ["/usr/bin/tini", "--"]
|
| 38 |
CMD ["/home/node/start.sh"]
|