z90486091 commited on
Commit
8f8742d
·
1 Parent(s): aa807e7
Files changed (1) hide show
  1. Dockerfile +10 -0
Dockerfile CHANGED
@@ -6,5 +6,15 @@ ENV OPENCODE_SERVER_USERNAME=opencode
6
  # Port configuration
7
  EXPOSE 8860
8
 
 
 
 
 
 
 
 
 
 
 
9
  # Start web server
10
  CMD ["web", "--port", "8860", "--hostname", "0.0.0.0"]
 
6
  # Port configuration
7
  EXPOSE 8860
8
 
9
+
10
+ # Create startup script to set secret at runtime
11
+ RUN echo '#!/bin/sh' > /entrypoint.sh && \
12
+ echo 'if [ -n "$HF_OPENCODE_PASSWORD" ]; then' >> /entrypoint.sh && \
13
+ echo ' export OPENCODE_SERVER_PASSWORD="$HF_OPENCODE_PASSWORD"' >> /entrypoint.sh && \
14
+ echo 'fi' >> /entrypoint.sh && \
15
+ echo 'exec opencode "$@"' >> /entrypoint.sh && \
16
+ chmod +x /entrypoint.sh
17
+
18
+ ENTRYPOINT ["/entrypoint.sh"]
19
  # Start web server
20
  CMD ["web", "--port", "8860", "--hostname", "0.0.0.0"]