wwforonce commited on
Commit
5937fb3
·
1 Parent(s): 6fe053e
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,6 +1,7 @@
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
  # Install dependencies
 
4
  RUN apt update && apt install -y \
5
  software-properties-common \
6
  gcc \
@@ -11,12 +12,28 @@ RUN apt update && apt install -y \
11
  wget \
12
  jq \
13
  python3 \
14
- npm \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- RUN npm install npm@latest -g && \
18
- npm install n -g && \
19
- n latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  # Install Python packages
22
  RUN pip install --no-cache-dir \
 
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
  # Install dependencies
4
+ # Install essential build tools and dependencies
5
  RUN apt update && apt install -y \
6
  software-properties-common \
7
  gcc \
 
12
  wget \
13
  jq \
14
  python3 \
15
+ # We will install Node.js and npm using nvm or a direct method, not apt's potentially older versions
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Install nvm (Node Version Manager) and then use it to install Node.js and npm
19
+ # This ensures a clean and controlled Node.js/npm environment
20
+ ENV NVM_DIR /usr/local/nvm
21
+ ENV NODE_VERSION 20.17.0
22
+ # Specify a compatible Node.js version, matching the earlier error message's requirement
23
+
24
+ # Optionally, if a specific npm version is absolutely required by the application
25
+ # and not provided by the Node.js version installed by nvm:
26
+ # If a specific npm version like 11.5.2 was truly needed: npm install -g npm@11.5.2
27
+
28
+ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
29
+ . "$NVM_DIR/nvm.sh" && \
30
+ nvm install $NODE_VERSION && \
31
+ nvm use $NODE_VERSION && \
32
+ nvm alias default $NODE_VERSION && \
33
+ npm install -g npm@latest
34
+
35
+ # Verify Node.js and npm versions
36
+ RUN node -v && npm -v
37
 
38
  # Install Python packages
39
  RUN pip install --no-cache-dir \