jbilcke-hf commited on
Commit
85b24ae
·
verified ·
1 Parent(s): 154ed69

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -23
Dockerfile CHANGED
@@ -11,10 +11,14 @@ ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 8.9 9.0 10.0 12.0"
11
  # Install dependencies
12
  RUN apt-get update && apt-get install --no-install-recommends -y \
13
  git \
 
14
  curl \
15
  build-essential \
16
  cmake \
17
  wget \
 
 
 
18
  python3.10 \
19
  python3-pip \
20
  python3-dev \
@@ -43,41 +47,29 @@ RUN curl -sL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh && \
43
  apt-get clean && \
44
  rm -rf /var/lib/apt/lists/*
45
 
 
 
 
 
46
  WORKDIR /app
47
 
48
  # Set aliases for python and pip
49
  RUN ln -s /usr/bin/python3 /usr/bin/python
50
 
51
- # install pytorch before cache bust to avoid redownloading pytorch
52
- RUN pip install --pre --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
53
-
54
- # Fix cache busting by moving CACHEBUST to right before git clone
55
- ARG CACHEBUST=1234
56
- ARG GIT_COMMIT=main
57
- RUN echo "Cache bust: ${CACHEBUST}" && \
58
- git clone https://github.com/ostris/ai-toolkit.git && \
59
- cd ai-toolkit && \
60
- git checkout ${GIT_COMMIT}
61
-
62
- WORKDIR /app/ai-toolkit
63
 
64
  # Install Python dependencies
65
  RUN pip install --no-cache-dir -r requirements.txt && \
66
  pip install --pre --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 --force && \
67
  pip install setuptools==69.5.1 --no-cache-dir
68
 
69
- # Build UI (generate temporary Prisma client for Next.js build)
70
- WORKDIR /app/ai-toolkit/ui
71
- RUN npm install && \
72
- npx prisma generate --schema prisma/schema.prisma && \
73
- npm run build
74
 
75
- # Expose port (assuming the application runs on port 3000)
76
  EXPOSE 8675
77
 
78
- WORKDIR /
79
-
80
- COPY start.sh /start.sh
81
- RUN chmod +x /start.sh
82
 
83
- CMD ["/start.sh"]
 
 
 
 
11
  # Install dependencies
12
  RUN apt-get update && apt-get install --no-install-recommends -y \
13
  git \
14
+ git-lfs \
15
  curl \
16
  build-essential \
17
  cmake \
18
  wget \
19
+ procps \
20
+ vim \
21
+ nano \
22
  python3.10 \
23
  python3-pip \
24
  python3-dev \
 
47
  apt-get clean && \
48
  rm -rf /var/lib/apt/lists/*
49
 
50
+ # Create Dev Mode compatible user
51
+ RUN useradd -m -u 1000 user
52
+
53
+ # Set working directory to /app
54
  WORKDIR /app
55
 
56
  # Set aliases for python and pip
57
  RUN ln -s /usr/bin/python3 /usr/bin/python
58
 
59
+ COPY --chown=1000 ./ /app
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  # Install Python dependencies
62
  RUN pip install --no-cache-dir -r requirements.txt && \
63
  pip install --pre --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 --force && \
64
  pip install setuptools==69.5.1 --no-cache-dir
65
 
66
+ RUN cd /app/ui && npm install
 
 
 
 
67
 
 
68
  EXPOSE 8675
69
 
70
+ WORKDIR /app
 
 
 
71
 
72
+ RUN chown 1000 /app
73
+ RUN chmod +x /app/start.sh
74
+ USER 1000
75
+ CMD ["/app/start.sh"]