File size: 1,291 Bytes
0ccf2f0
55d584b
 
 
 
 
0ccf2f0
 
55d584b
0ccf2f0
 
 
 
 
 
 
 
 
 
 
dd9d03a
55d584b
dd9d03a
82f450e
 
 
 
 
dd9d03a
0ccf2f0
55d584b
dd9d03a
 
 
0ccf2f0
 
 
 
 
55d584b
0ccf2f0
 
55d584b
0ccf2f0
114fb2f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Warbler CDA - Production FastAPI Service for HuggingFace Spaces
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install minimal system dependencies
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /var/cache/apt/*

# Copy requirements and install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt \
    && rm -rf ~/.cache/pip \
    && rm -rf /root/.cache \
    && rm -rf /tmp/*

# Copy the warbler_cda module
COPY warbler_cda/ ./warbler_cda/

# Copy committed packs that stay in repo (per .gitignore)
COPY packs/warbler-pack-core/ ./packs/warbler-pack-core/
COPY packs/warbler-pack-faction-politics/ ./packs/warbler-pack-faction-politics/
COPY packs/warbler-pack-wisdom-scrolls/ ./packs/warbler-pack-wisdom-scrolls/

# Copy server startup script
COPY start_server.py ./

# Create packs directory (will be populated on first run)
RUN mkdir -p ./packs

# Set environment variables for HuggingFace Spaces
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV HOST=0.0.0.0
ENV PORT=7860

# Expose HuggingFace Spaces default port
EXPOSE 7860

# Run the FastAPI server
CMD ["python", "start_server.py", "--host", "0.0.0.0", "--port", "7860"]