Skip to content

Commit

Permalink
Removed stage from CDC data dockerfile to reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
dwnoble committed Dec 26, 2024
1 parent 53037e1 commit d827cb1
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions build/cdc_data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ RUN mkdir -p /tmp/datcom-nl-models \
&& gsutil -m cp -R gs://datcom-nl-models/ft_final_v20230717230459.all-MiniLM-L6-v2/ /tmp/datcom-nl-models/


# #### Stage 2: Install python dependencies. ####
FROM python:3.11.4-slim AS dependencies-installer
# #### Stage 2: Python runtime. ####
FROM python:3.11.4-slim AS runner

ARG ENV
ENV ENV=${ENV}

WORKDIR /workspace

# Copy models
COPY --from=model-downloader /tmp/datcom-nl-models /tmp/datcom-nl-models

# Copy simple importer requirements.
COPY import/simple/requirements.txt ./import/simple/requirements.txt

Expand All @@ -46,20 +52,6 @@ RUN sed -i'' '/lancedb/d' /workspace/nl_requirements.txt \
&& pip3 install torch==2.2.2 --extra-index-url https://download.pytorch.org/whl/cpu \
&& pip3 install -r ./tools/nl/embeddings/requirements.txt


# #### Stage 3: Runtime env. ####
FROM python:3.11.4-slim AS runner

ARG ENV
ENV ENV=${ENV}

WORKDIR /workspace

# Copy models and dependencies.
COPY --from=dependencies-installer /workspace/ .
COPY --from=dependencies-installer /workspace/venv /workspace/venv
COPY --from=model-downloader /tmp/datcom-nl-models /tmp/datcom-nl-models

# Copy the embeddings builder module.
COPY tools/nl/embeddings/. ./tools/nl/embeddings/
# Copy the shared module.
Expand Down

0 comments on commit d827cb1

Please sign in to comment.