abhay2245 commited on
Commit
3691c7a
·
verified ·
1 Parent(s): 268818d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -8
Dockerfile CHANGED
@@ -4,20 +4,26 @@ FROM theteamultroid/ultroid:main
4
  ENV TZ=Asia/Kolkata
5
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
6
 
 
7
  COPY installer.sh .
 
8
  RUN bash installer.sh
9
 
 
 
 
 
10
  # changing workdir
11
  WORKDIR "/root/TeamUltroid"
12
 
13
- # Install additional requirements for web interface
14
- RUN pip install flask
15
-
16
- # Copy web interface script
17
- COPY web_interface.py .
18
 
19
- # Expose port 7860 (required by HF Spaces)
20
  EXPOSE 7860
21
 
22
- # Start both the bot and web interface
23
- CMD bash -c "bash startup & python web_interface.py"
 
 
 
 
4
  ENV TZ=Asia/Kolkata
5
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
6
 
7
+ # Copy and run installer
8
  COPY installer.sh .
9
+ RUN chmod +x installer.sh
10
  RUN bash installer.sh
11
 
12
+ # Copy all files and set proper permissions
13
+ COPY . /root/TeamUltroid
14
+ RUN chmod -R 755 /root/TeamUltroid
15
+
16
  # changing workdir
17
  WORKDIR "/root/TeamUltroid"
18
 
19
+ # Fix Python path for pyUltroid module
20
+ ENV PYTHONPATH="/root/TeamUltroid:$PYTHONPATH"
 
 
 
21
 
22
+ # Expose port for HF Spaces
23
  EXPOSE 7860
24
 
25
+ # Create a simple web server and run bot
26
+ RUN echo 'from flask import Flask; import subprocess; import threading; app = Flask(__name__); @app.route("/"):def home():return "<h1>Ultroid is Running!</h1><p>Bot is active in background</p>"; def run_bot():subprocess.run(["bash", "startup"]); threading.Thread(target=run_bot, daemon=True).start(); app.run(host="0.0.0.0", port=7860)' > web_server.py
27
+
28
+ # Run the web server with bot in background
29
+ CMD ["python", "web_server.py"]