Update Dockerfile
Browse files- Dockerfile +24 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,30 @@
|
|
| 1 |
FROM node:20-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
RUN npm install -
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
EXPOSE 7860
|
| 12 |
-
|
|
|
|
|
|
|
|
|
| 1 |
FROM node:20-slim
|
| 2 |
|
| 3 |
+
# Basic utilities:
|
| 4 |
+
# - tini: proper signal handling as PID 1
|
| 5 |
+
# - rsync: for safe migration of existing dirs into /data on first boot
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
ca-certificates \
|
| 8 |
+
git \
|
| 9 |
+
bash \
|
| 10 |
+
tini \
|
| 11 |
+
rsync \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Install OpenCode (npm)
|
| 15 |
+
RUN npm install -g opencode-ai
|
| 16 |
|
| 17 |
+
# Non-root user (matches common HF Spaces practice)
|
| 18 |
+
RUN useradd -m -u 1000 user
|
| 19 |
+
USER user
|
| 20 |
+
WORKDIR /home/user
|
| 21 |
+
|
| 22 |
+
COPY --chown=user:user start.sh /home/user/start.sh
|
| 23 |
+
COPY --chown=user:user opencode.json.example /home/user/opencode.json.example
|
| 24 |
+
|
| 25 |
+
RUN chmod +x /home/user/start.sh
|
| 26 |
|
| 27 |
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
ENTRYPOINT ["/usr/bin/tini", "--"]
|
| 30 |
+
CMD ["/home/user/start.sh"]
|