rkihacker commited on
Commit
936c97e
·
verified ·
1 Parent(s): 506e25c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,12 +1,29 @@
1
- FROM python:3.11-slim
 
2
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
 
 
 
 
 
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY main.py .
 
9
 
 
10
  EXPOSE 8000
11
 
12
- CMD ["python", "main.py"]
 
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.10-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Create working directory
9
  WORKDIR /app
10
 
11
+ # Install system dependencies (optional but often needed for FastAPI/uvicorn)
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ curl \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Download requirements.txt from Hugging Face
17
+ RUN curl -o requirements.txt https://huggingface.co/datasets/rkihacker/HellFire/raw/main/requirements.txt
18
+
19
+ # Install Python dependencies
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Download the main FastAPI app
23
+ RUN curl -o main.py https://huggingface.co/datasets/rkihacker/HellFire/raw/main/main.py
24
 
25
+ # Expose FastAPI default port
26
  EXPOSE 8000
27
 
28
+ # Command to run the FastAPI app with uvicorn
29
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]