Skip to content

Commit 4e87466

Browse files
committed
feat: added docker build arguments to modal server
1 parent d8b7b1a commit 4e87466

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Dockerfile-Modal

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM debian:bullseye-slim AS build-image
22

3-
#ARG MODEL
4-
#ENV MODEL=${MODEL}
3+
ARG MODEL
4+
ARG HOME
5+
ENV MODEL=${MODEL}
56
COPY ${HOME}/download.sh ./
67

78
# Install build dependencies
@@ -15,7 +16,7 @@ RUN chmod +x *.sh && \
1516
# Grab a fresh copy of the Python image
1617
FROM python:3.11-slim
1718

18-
#ARG MODEL
19+
ARG MODEL
1920

2021
RUN mkdir -p ${MODEL}
2122
COPY --from=build-image ${MODEL} ${MODEL}

open/text/embeddings/server/modal.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
app = App(os.environ["APP_NAME"])
66

77
image = Image.from_dockerfile(
8-
"Dockerfile-Modal", force_build=True
8+
"Dockerfile-Modal",
9+
force_build=True,
10+
build_args={
11+
"MODEL": os.environ["MODEL"],
12+
"HOME": os.environ["HOME"],
13+
}
914
).env({
1015
"MODEL": os.environ["MODEL"],
1116
"NORMALIZE_EMBEDDINGS": os.environ["NORMALIZE_EMBEDDINGS"],
1217
"VERBOSE": os.environ["VERBOSE"],
13-
"HOME": os.environ["HOME"],
1418
"HF_HOME": "/tmp/hf_home",
1519
})
1620

0 commit comments

Comments
 (0)