# EasyAI 部署脚本验证环境
# 在 Docker 容器内运行 start.sh，通过挂载 Docker Socket 使用宿主机 Docker 启动服务
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    gnupg \
    lsb-release \
    git \
    sudo \
    && rm -rf /var/lib/apt/lists/*

# 安装 Docker CLI（使用宿主机 Docker 守护进程）
RUN install -m 0755 -d /etc/apt/keyrings \
    && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
    && chmod a+r /etc/apt/keyrings/docker.gpg \
    && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list \
    && apt-get update \
    && apt-get install -y --no-install-recommends docker-ce-cli docker-compose-plugin \
    && rm -rf /var/lib/apt/lists/*

# 创建工作目录
WORKDIR /workspace/easyai

# 复制项目文件（运行时通过 volume 挂载覆盖）
COPY . /workspace/easyai/

# 允许以 root 运行（容器内通常为 root）
ENV DEPLOY_ACCESS=ip
ENV DEPLOY_IP=127.0.0.1
