Spaces:
Running
Running
Commit
•
0786d00
1
Parent(s):
e5996cb
feat: fixed global arg error and tidy up code
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
@@ -1,7 +1,10 @@
|
|
|
|
1 |
ARG MODEL="BAAI/bge-large-en"
|
2 |
|
3 |
FROM debian:bullseye-slim AS build-image
|
4 |
|
|
|
|
|
5 |
ENV MODEL=${MODEL}
|
6 |
|
7 |
COPY ./download.sh ./
|
@@ -18,24 +21,21 @@ RUN chmod +x *.sh && \
|
|
18 |
# Grab a fresh copy of the Python image
|
19 |
FROM python:3.10-slim
|
20 |
|
|
|
|
|
21 |
ENV MODEL=${MODEL}
|
22 |
ENV NORMALIZE_EMBEDDINGS=1
|
|
|
|
|
|
|
23 |
|
24 |
-
RUN mkdir -p ${MODEL} && mkdir -p open/text/embeddings
|
25 |
COPY --from=build-image ${MODEL} ${MODEL}
|
26 |
COPY open/text/embeddings ./open/text/embeddings
|
27 |
COPY server-requirements.txt ./
|
28 |
-
RUN pip install --no-cache-dir -r server-requirements.txt
|
29 |
-
|
30 |
COPY ./start_server.sh ./
|
31 |
COPY ./index.html ./
|
32 |
-
|
33 |
-
|
34 |
-
RUN chmod +x ./start_server.sh
|
35 |
-
|
36 |
-
# Set environment variable for the host
|
37 |
-
ENV HOST=0.0.0.0
|
38 |
-
ENV PORT=7860
|
39 |
|
40 |
# Expose a port for the server
|
41 |
EXPOSE ${PORT}
|
|
|
1 |
+
# Define global args
|
2 |
ARG MODEL="BAAI/bge-large-en"
|
3 |
|
4 |
FROM debian:bullseye-slim AS build-image
|
5 |
|
6 |
+
# Include global args in this stage of the build
|
7 |
+
ARG MODEL
|
8 |
ENV MODEL=${MODEL}
|
9 |
|
10 |
COPY ./download.sh ./
|
|
|
21 |
# Grab a fresh copy of the Python image
|
22 |
FROM python:3.10-slim
|
23 |
|
24 |
+
# Include global args in this stage of the build
|
25 |
+
ARG MODEL
|
26 |
ENV MODEL=${MODEL}
|
27 |
ENV NORMALIZE_EMBEDDINGS=1
|
28 |
+
# Set environment variable for the host
|
29 |
+
ENV HOST=0.0.0.0
|
30 |
+
ENV PORT=7860
|
31 |
|
|
|
32 |
COPY --from=build-image ${MODEL} ${MODEL}
|
33 |
COPY open/text/embeddings ./open/text/embeddings
|
34 |
COPY server-requirements.txt ./
|
|
|
|
|
35 |
COPY ./start_server.sh ./
|
36 |
COPY ./index.html ./
|
37 |
+
RUN pip install --no-cache-dir -r server-requirements.txt \
|
38 |
+
chmod +x ./start_server.sh
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Expose a port for the server
|
41 |
EXPOSE ${PORT}
|