pvanand commited on
Commit
e270f2d
·
verified ·
1 Parent(s): 24fb417

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -29,5 +29,11 @@ RUN uv pip install --no-cache-dir -r requirements.txt
29
  # Ensure the correct permissions for hrequests library path
30
  RUN chmod -R a+w /usr/local/lib/python3.10/site-packages/hrequests/bin/
31
 
32
- # Start the FastAPI app on port 7860, the default port expected by Spaces
33
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
29
  # Ensure the correct permissions for hrequests library path
30
  RUN chmod -R a+w /usr/local/lib/python3.10/site-packages/hrequests/bin/
31
 
32
+ # Create a startup script
33
+ RUN echo '#!/bin/bash' > /app/start.sh && \
34
+ echo 'source /app/.venv/bin/activate' >> /app/start.sh && \
35
+ echo 'exec uvicorn main:app --host 0.0.0.0 --port 7860' >> /app/start.sh && \
36
+ chmod +x /app/start.sh
37
+
38
+ # Use the startup script to run the application
39
+ CMD ["/app/start.sh"]