File size: 1,237 Bytes
8cf357f
f64b002
 
 
b3b36f7
 
f64b002
 
b3b36f7
 
 
f64b002
 
b3b36f7
f64b002
 
 
b3b36f7
f64b002
2c56f6b
b3b36f7
 
1a2d1b3
 
db6c149
 
f64b002
8d37fa0
 
 
b3b36f7
 
 
 
 
 
 
 
 
1e6ab4d
 
 
f1e4efb
 
b3b36f7
 
1e6ab4d
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
47
48
FROM python:3.11-slim

WORKDIR /code

# OS deps: redis-server + supervisor + build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
    libpq-dev \
    redis-server \
    supervisor \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Python deps
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# App code
COPY ./app /code/app
COPY ./config /code/config
COPY ./adapters /code/adapters
COPY ./worker /code/worker
COPY ./pipelines /code/pipelines
COPY ./migrations /code/migrations
COPY ./deep_learning /code/deep_learning
COPY ./backtest /code/backtest

# Copy pre-trained model files (from Kaggle)
COPY ./data/models /data/models

# Supervisor config
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# HF Spaces default port: 7860
EXPOSE 7860

# Environment
ENV PYTHONUNBUFFERED=1 \
    PYTHONPATH=/code \
    REDIS_URL=redis://127.0.0.1:6379/0 \
    HF_HUB_DISABLE_PROGRESS_BARS=1 \
    TRANSFORMERS_VERBOSITY=error \
    TRANSFORMERS_NO_ADVISORY_WARNINGS=1 \
    TOKENIZERS_PARALLELISM=false

# Run supervisord (manages redis + api + worker)
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]