#docker build -f Dockerfile.job -t kgbuilder-job:1.0 .  
FROM kgbuilder:latest 
#RUN apt-get remove -y python3-dev libpq-dev
#RUN apt-get remove -y build-essential 
#RUN apt-get clean
RUN apt-get update
#RUN apt-get install -y libgtk-dotnet3.0-cil-dev
#RUN apt-get install -y libicu72
COPY . /app
# 设置环境变量（这些环境变量可以在容器启动时覆盖）
ENV POSTGRESQL_HOST="localhost"
ENV POSTGRESQL_DATABASE="kg"
ENV POSTGRESQL_USER="postgres"
#ENV POSTGRESQL_PASSWORD="difyai123456"
ENV DEEPSEEK_API_URL="https://api.siliconflow.cn/v1/chat/completions"
#ENV DEEPSEEK_API_KEY="sk-vecnpjmtmelcefdbtbbpqvzcegopxrherbnbjhscugbpxuif"
ENV JOB_PATH="/app/agent/jobs"
ENV JOB_SCRIPT_PATH="/app/agent/job_script"
# 创建日志目录
RUN mkdir -p /app/logs

# 创建一个启动脚本
RUN echo '#!/bin/bash' > /start.sh && \
    echo 'source /opt/conda/etc/profile.d/conda.sh' >> /start.sh && \
    echo 'conda activate kgbuilder' >> /start.sh && \
    echo 'cd /app' >> /start.sh && \
    echo 'python executor/main.py' >> /start.sh && \
    chmod +x /start.sh

# 设置默认命令
CMD ["/bin/bash", "/start.sh"]
