mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-21 06:49:08 +00:00
Rework docker
This commit is contained in:
@@ -1,31 +1,66 @@
|
||||
FROM runpod/base:0.6.2-cuda12.2.0
|
||||
FROM nvidia/cuda:12.6.3-base-ubuntu22.04
|
||||
|
||||
LABEL authors="jaret"
|
||||
|
||||
# Set noninteractive to avoid timezone prompts
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
git \
|
||||
curl \
|
||||
build-essential \
|
||||
cmake \
|
||||
wget \
|
||||
python3.10 \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
python3-venv \
|
||||
ffmpeg \
|
||||
tmux \
|
||||
htop \
|
||||
nvtop \
|
||||
python3-opencv \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install nodejs
|
||||
WORKDIR /tmp
|
||||
RUN curl -sL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh && \
|
||||
bash nodesource_setup.sh && \
|
||||
apt-get update && \
|
||||
apt-get install -y nodejs && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
ARG CACHEBUST=1
|
||||
RUN git clone https://github.com/ostris/ai-toolkit.git && \
|
||||
|
||||
# Fix cache busting by moving CACHEBUST to right before git clone
|
||||
ARG CACHEBUST=1234
|
||||
RUN echo "Cache bust: ${CACHEBUST}" && \
|
||||
git clone https://github.com/ostris/ai-toolkit.git && \
|
||||
cd ai-toolkit && \
|
||||
git submodule update --init --recursive
|
||||
|
||||
WORKDIR /app/ai-toolkit
|
||||
|
||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
||||
RUN python -m pip install -r requirements.txt
|
||||
# Set aliases for python and pip
|
||||
RUN echo 'alias python=python3' >> /etc/bash.bashrc && \
|
||||
echo 'alias pip=pip3' >> /etc/bash.bashrc
|
||||
|
||||
RUN apt-get install -y tmux nvtop htop
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu126 && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN pip install jupyterlab
|
||||
# Build UI
|
||||
WORKDIR /app/ai-toolkit/ui
|
||||
RUN npm install && \
|
||||
npm run build && \
|
||||
npm run update_db
|
||||
|
||||
# mask workspace
|
||||
RUN mkdir /workspace
|
||||
# Expose port (assuming the application runs on port 3000)
|
||||
EXPOSE 8675
|
||||
|
||||
|
||||
# symlink app to workspace
|
||||
RUN ln -s /app/ai-toolkit /workspace/ai-toolkit
|
||||
|
||||
WORKDIR /
|
||||
CMD ["/start.sh"]
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user