update
Browse files- Dockerfile +15 -10
Dockerfile
CHANGED
|
@@ -31,17 +31,22 @@ USER opencode
|
|
| 31 |
# Create user's bin directory
|
| 32 |
RUN mkdir -p /home/opencode/.local/bin
|
| 33 |
|
| 34 |
-
# Create startup script
|
| 35 |
-
RUN
|
| 36 |
-
|
| 37 |
-
echo "
|
| 38 |
-
echo "
|
| 39 |
-
|
| 40 |
-
exec /usr/local/bin/opencode serve --hostname 0.0.0.0 --port 7860
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Expose the port that HuggingFace Spaces expects
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
CMD ["/
|
|
|
|
| 31 |
# Create user's bin directory
|
| 32 |
RUN mkdir -p /home/opencode/.local/bin
|
| 33 |
|
| 34 |
+
# Create startup script using cat with heredoc to avoid newline issues
|
| 35 |
+
RUN cat > /home/opencode/.local/bin/start.sh << 'EOF'
|
| 36 |
+
#!/bin/ash
|
| 37 |
+
echo "Starting OpenCode AI Web Server..."
|
| 38 |
+
echo "Server will be available at http://0.0.0.0:7860 "
|
| 39 |
+
echo "OpenAPI documentation available at http://0.0.0.0:7860/doc "
|
| 40 |
+
exec /usr/local/bin/opencode serve --hostname 0.0.0.0 --port 7860
|
| 41 |
+
EOF
|
| 42 |
+
|
| 43 |
+
RUN chmod +x /home/opencode/.local/bin/start.sh
|
| 44 |
+
|
| 45 |
+
# 调试:验证脚本内容
|
| 46 |
+
RUN cat -A /home/opencode/.local/bin/start.sh
|
| 47 |
|
| 48 |
# Expose the port that HuggingFace Spaces expects
|
| 49 |
EXPOSE 7860
|
| 50 |
|
| 51 |
+
# 简化CMD,直接执行脚本
|
| 52 |
+
CMD ["/home/opencode/.local/bin/start.sh"]
|