| |
| |
|
|
| FROM python:3.11-slim |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV PYTHONPATH="/app" |
| ENV GRADIO_SERVER_NAME="0.0.0.0" |
| ENV GRADIO_SERVER_PORT=7860 |
| ENV FREQTRADE_ENV=production |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| wget \ |
| git \ |
| supervisor \ |
| nginx \ |
| pkg-config \ |
| libffi-dev \ |
| libssl-dev \ |
| libhdf5-dev \ |
| libatlas-base-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \ |
| tar -xzf ta-lib-0.4.0-src.tar.gz && \ |
| cd ta-lib/ && \ |
| ./configure --prefix=/usr && \ |
| make && make install && \ |
| cd .. && rm -rf ta-lib ta-lib-0.4.0-src.tar.gz |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.full.txt . |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.full.txt |
|
|
| |
| RUN mkdir -p /app/user_data/{strategies,data,logs,backtest_results,models} \ |
| /app/config \ |
| /app/supervisor \ |
| /var/log/supervisor \ |
| /var/log/freqtrade |
|
|
| |
| COPY user_data/ ./user_data/ |
| COPY freqtrade/ ./freqtrade/ |
| COPY frequi/ ./frequi/ |
| COPY config/ ./config/ |
| COPY scripts/ ./scripts/ |
|
|
| |
| COPY supervisor/ ./supervisor/ |
|
|
| |
| COPY app_orchestrator.py . |
| COPY health_monitor.py . |
|
|
| |
| RUN chmod +x scripts/*.py && \ |
| chmod -R 755 /app/user_data && \ |
| chmod 644 config/*.json |
|
|
| |
| COPY supervisor.conf /etc/supervisor/conf.d/freqtrade.conf |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] |