File size: 554 Bytes
fd7873e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY qrypto/ ./qrypto/
COPY api/ ./api/

# Spaces mount persistent storage at /data when enabled; db.py falls back to /tmp if it isn't writable.
ENV QRYPTO_DATA_DIR=/data
RUN mkdir -p /data && chmod 777 /data

EXPOSE 7860

# Single worker on purpose: the bot manager holds live runner state in-process.
CMD ["uvicorn", "api.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]