factorstudios commited on
Commit
8e5a44f
·
verified ·
1 Parent(s): 80c670e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -2,26 +2,25 @@ FROM python:3.13-slim
2
 
3
  WORKDIR /app
4
 
5
- # Copy requirements and install dependencies
 
 
 
 
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt && \
8
  pip install --no-cache-dir uvicorn[standard]==0.24.0
9
 
10
- # Copy the application files (standalone - no parent folders)
11
  COPY content_gen.py .
12
  COPY main.py .
13
 
14
- # Expose port
15
  EXPOSE 7860
16
 
17
- # Set environment variables
18
  ENV HOST=0.0.0.0
19
  ENV PORT=7860
20
  ENV WORKERS=1
21
 
22
- # Health check
23
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
24
- CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
25
 
26
- # Run with uvicorn
27
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install build deps for pydantic-core Rust compilation
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt && \
12
  pip install --no-cache-dir uvicorn[standard]==0.24.0
13
 
 
14
  COPY content_gen.py .
15
  COPY main.py .
16
 
 
17
  EXPOSE 7860
18
 
 
19
  ENV HOST=0.0.0.0
20
  ENV PORT=7860
21
  ENV WORKERS=1
22
 
 
23
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
24
+ CMD python -c "import requests; requests.get('http://localhost:7860/health')" || exit 1
25
 
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]