crypto.ai/Dockerfile
2025-04-29 00:21:17 +08:00

37 lines
893 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 安装基本依赖
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY . /app/
# 安装Python依赖
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# 创建配置文件目录
RUN mkdir -p /app/config
# 如果需要从示例配置创建配置文件
RUN if [ -f "/app/cryptoai/config/config.example.yaml" ] && [ ! -f "/app/cryptoai/config/config.yaml" ]; then \
cp /app/cryptoai/config/config.example.yaml /app/cryptoai/config/config.yaml; \
fi
# 创建数据目录
RUN mkdir -p /app/cryptoai/data /app/logs
# 暴露端口如果有Web服务
# EXPOSE 8000
# 设置容器启动命令
ENTRYPOINT ["python", "run.py"]