maylinejix commited on
Commit
60b50b8
·
verified ·
1 Parent(s): dc84929

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ gcc \
9
+ g++ \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements file
13
+ COPY requirements.txt .
14
+
15
+ # Install Python dependencies
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy application files
19
+ COPY app.py .
20
+
21
+ # Create temp directory for downloads
22
+ RUN mkdir -p /tmp
23
+
24
+ # Expose port (Hugging Face Spaces uses 7860 by default)
25
+ EXPOSE 7860
26
+
27
+ # Set environment variables
28
+ ENV PORT=7860
29
+ ENV PYTHONUNBUFFERED=1
30
+
31
+ # Run the application
32
+ CMD ["python", "app.py"]