# Use the rocm-base-aarch64-dockerfile
FROM mistox/rocm-aarch64-base:latest AS base

# Set Workdir
WORKDIR /app

# Clone ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git .

# Install depencies
RUN grep -vE "^(torch|#)" requirements.txt | xargs pip install && \
    pip install torchsde imageio controlnet_aux

# Set custom Nodes
WORKDIR /app/custom_nodes

# Install ComfyUi Manager
RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git

# Go back to root
WORKDIR /app

# Expose the default ComfyUI port
EXPOSE 8188

# Launch ComfyUI
CMD ["python3", "main.py", "--listen", "0.0.0.0"]