forked from open-webui/open-webui
Reduce container image size
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
parent
0ab33bd5f3
commit
4ee655c075
1 changed files with 5 additions and 7 deletions
10
Dockerfile
10
Dockerfile
|
@ -5,7 +5,8 @@ FROM node:alpine as build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# wget embedding model weight from alpine (does not exist from slim-buster)
|
# wget embedding model weight from alpine (does not exist from slim-buster)
|
||||||
RUN wget "https://chroma-onnx-models.s3.amazonaws.com/all-MiniLM-L6-v2/onnx.tar.gz"
|
RUN wget "https://chroma-onnx-models.s3.amazonaws.com/all-MiniLM-L6-v2/onnx.tar.gz" -O - | \
|
||||||
|
tar -xzf - -C /app
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
@ -44,10 +45,7 @@ RUN apt-get update \
|
||||||
|
|
||||||
# copy embedding weight from build
|
# copy embedding weight from build
|
||||||
RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
|
RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
|
||||||
COPY --from=build /app/onnx.tar.gz /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
|
COPY --from=build /app/onnx /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2/onnx
|
||||||
|
|
||||||
RUN cd /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 &&\
|
|
||||||
tar -xzf onnx.tar.gz
|
|
||||||
|
|
||||||
# copy built frontend files
|
# copy built frontend files
|
||||||
COPY --from=build /app/build /app/build
|
COPY --from=build /app/build /app/build
|
||||||
|
@ -55,4 +53,4 @@ COPY --from=build /app/build /app/build
|
||||||
# copy backend files
|
# copy backend files
|
||||||
COPY ./backend .
|
COPY ./backend .
|
||||||
|
|
||||||
CMD [ "sh", "start.sh"]
|
CMD [ "sh", "start.sh" ]
|
Loading…
Reference in a new issue