limitedonly41 commited on
Commit
ea9a339
·
verified ·
1 Parent(s): ac33056

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ redis-server \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements file
11
+ COPY requirements.txt .
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy the entire app directory
17
+ COPY ./app ./app
18
+
19
+ # Expose port 7860 (required by Hugging Face Spaces)
20
+ EXPOSE 7860
21
+
22
+ # Create a startup script
23
+ RUN echo '#!/bin/bash\n\
24
+ redis-server --daemonize yes\n\
25
+ sleep 2\n\
26
+ uvicorn app.main:app --host 0.0.0.0 --port 7860\n\
27
+ ' > /start.sh && chmod +x /start.sh
28
+
29
+ # Run the startup script
30
+ CMD ["/start.sh"]