Skip to content

Commit d0605d2

Browse files
chatbot-rag-app: reduces docker image size (#407)
Signed-off-by: Adrian Cole <[email protected]>
1 parent 9a5ebf1 commit d0605d2

File tree

5 files changed

+27
-32
lines changed

5 files changed

+27
-32
lines changed

Diff for: docker/docker-compose-elastic.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ services:
6969
- XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=fhjskloppd678ehkdfdlliverpoolfcr
7070
- SERVER_PUBLICBASEURL=http://127.0.0.1:5601
7171
healthcheck:
72-
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'All services are available'"]
72+
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'available'"]
7373
retries: 300
7474
interval: 1s
7575

Diff for: example-apps/chatbot-rag-app/Dockerfile

+5-10
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,19 @@ COPY frontend ./frontend
55
RUN cd frontend && yarn install
66
RUN cd frontend && REACT_APP_API_HOST=/api yarn build
77

8+
# langchain and vertexai depend on a large number of system packages including
9+
# linux-headers, g++, geos, geos-dev, rust and cargo. These are already present
10+
# on -slim and adding them to -alpine results in a larger image than -slim.
811
FROM python:3.12-slim
912

1013
WORKDIR /app
1114
RUN mkdir -p ./frontend/build
1215
COPY --from=build-step ./app/frontend/build ./frontend/build
13-
RUN mkdir ./api
14-
RUN mkdir ./data
15-
16-
RUN apt-get update && apt-get install -y \
17-
build-essential \
18-
curl \
19-
software-properties-common \
20-
git \
21-
&& rm -rf /var/lib/apt/lists/*
22-
2316

2417
COPY requirements.txt ./requirements.txt
2518
RUN pip3 install -r ./requirements.txt
19+
20+
RUN mkdir -p ./api ./data
2621
COPY api ./api
2722
COPY data ./data
2823

Diff for: example-apps/chatbot-rag-app/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ pip-compile
165165
pip install -r requirements.txt
166166
# Add opentelemetry instrumentation for these dependencies
167167
edot-bootstrap >> requirements.txt
168-
# Missing dependency for langtrace vertexai instrumentation
169-
echo "setuptools" >> requirements.txt
170168
# Install opentelemetry dependencies
171169
pip install -r requirements.txt
172170
```

Diff for: example-apps/chatbot-rag-app/requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ langchain-mistralai
1616

1717
# EDOT dependencies
1818
elastic-opentelemetry
19-
# Additional LLM support not in EDOT
19+
# Additional LLM support not yet in EDOT
2020
langtrace-python-sdk

Diff for: example-apps/chatbot-rag-app/requirements.txt

+20-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
aiohappyeyeballs==2.4.6
88
# via aiohttp
9-
aiohttp==3.11.12
9+
aiohttp==3.11.13
1010
# via
1111
# langchain
1212
# langchain-community
@@ -22,15 +22,15 @@ attrs==25.1.0
2222
# via aiohttp
2323
blinker==1.9.0
2424
# via flask
25-
boto3==1.36.24
25+
boto3==1.37.0
2626
# via
2727
# langchain-aws
2828
# langtrace-python-sdk
29-
botocore==1.36.24
29+
botocore==1.37.0
3030
# via
3131
# boto3
3232
# s3transfer
33-
cachetools==5.5.1
33+
cachetools==5.5.2
3434
# via google-auth
3535
certifi==2025.1.31
3636
# via
@@ -80,7 +80,7 @@ flask==3.1.0
8080
# via
8181
# -r requirements.in
8282
# flask-cors
83-
flask-cors==5.0.0
83+
flask-cors==5.0.1
8484
# via -r requirements.in
8585
frozenlist==1.5.0
8686
# via
@@ -109,11 +109,11 @@ google-cloud-aiplatform==1.81.0
109109
# via langchain-google-vertexai
110110
google-cloud-bigquery==3.29.0
111111
# via google-cloud-aiplatform
112-
google-cloud-core==2.4.1
112+
google-cloud-core==2.4.2
113113
# via
114114
# google-cloud-bigquery
115115
# google-cloud-storage
116-
google-cloud-resource-manager==1.14.0
116+
google-cloud-resource-manager==1.14.1
117117
# via google-cloud-aiplatform
118118
google-cloud-storage==2.19.0
119119
# via
@@ -127,7 +127,7 @@ google-resumable-media==2.7.2
127127
# via
128128
# google-cloud-bigquery
129129
# google-cloud-storage
130-
googleapis-common-protos[grpc]==1.67.0
130+
googleapis-common-protos[grpc]==1.68.0
131131
# via
132132
# google-api-core
133133
# grpc-google-iam-v1
@@ -164,7 +164,7 @@ httpx-sse==0.4.0
164164
# langchain-community
165165
# langchain-google-vertexai
166166
# langchain-mistralai
167-
huggingface-hub==0.29.0
167+
huggingface-hub==0.29.1
168168
# via
169169
# tokenizers
170170
# transformers
@@ -200,7 +200,7 @@ langchain-cohere==0.4.2
200200
# via -r requirements.in
201201
langchain-community==0.3.18
202202
# via langchain-cohere
203-
langchain-core==0.3.37
203+
langchain-core==0.3.39
204204
# via
205205
# langchain
206206
# langchain-aws
@@ -215,13 +215,13 @@ langchain-elasticsearch==0.3.2
215215
# via -r requirements.in
216216
langchain-google-vertexai==2.0.13
217217
# via -r requirements.in
218-
langchain-mistralai==0.2.6
218+
langchain-mistralai==0.2.7
219219
# via -r requirements.in
220-
langchain-openai==0.3.6
220+
langchain-openai==0.3.7
221221
# via -r requirements.in
222222
langchain-text-splitters==0.3.6
223223
# via langchain
224-
langsmith==0.3.8
224+
langsmith==0.3.11
225225
# via
226226
# langchain
227227
# langchain-community
@@ -250,7 +250,7 @@ numpy==2.2.3
250250
# langchain-community
251251
# shapely
252252
# transformers
253-
openai==1.63.2
253+
openai==1.64.0
254254
# via langchain-openai
255255
opentelemetry-api==1.30.0
256256
# via
@@ -323,11 +323,12 @@ packaging==24.2
323323
# google-cloud-bigquery
324324
# huggingface-hub
325325
# langchain-core
326+
# langsmith
326327
# marshmallow
327328
# opentelemetry-instrumentation
328329
# opentelemetry-instrumentation-sqlalchemy
329330
# transformers
330-
propcache==0.2.1
331+
propcache==0.3.0
331332
# via
332333
# aiohttp
333334
# yarl
@@ -372,7 +373,7 @@ pydantic-core==2.27.2
372373
# via
373374
# cohere
374375
# pydantic
375-
pydantic-settings==2.7.1
376+
pydantic-settings==2.8.0
376377
# via langchain-community
377378
python-dateutil==2.9.0.post0
378379
# via
@@ -491,7 +492,9 @@ urllib3==2.3.0
491492
# sentry-sdk
492493
# types-requests
493494
werkzeug==3.1.3
494-
# via flask
495+
# via
496+
# flask
497+
# flask-cors
495498
wrapt==1.17.2
496499
# via
497500
# deprecated
@@ -529,4 +532,3 @@ opentelemetry-instrumentation-system-metrics==0.51b0
529532
opentelemetry-instrumentation-tortoiseorm==0.51b0
530533
opentelemetry-instrumentation-urllib3==0.51b0
531534
elastic-opentelemetry-instrumentation-openai==0.6.0
532-
setuptools

0 commit comments

Comments
 (0)