forked from elastic/elasticsearch-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (29 loc) · 979 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM node:22-alpine AS build-step
WORKDIR /app
ENV PATH=/node_modules/.bin:$PATH
COPY frontend ./frontend
RUN cd frontend && yarn install
RUN cd frontend && REACT_APP_API_HOST=/api yarn build
# Use glibc-based image to get pre-compiled wheels for grpcio and tiktoken
FROM python:3.12-slim
WORKDIR /app
RUN mkdir -p ./frontend/build
COPY --from=build-step ./app/frontend/build ./frontend/build
COPY requirements.txt ./requirements.txt
RUN pip3 install -r ./requirements.txt
RUN mkdir -p ./api ./data
COPY api ./api
COPY data ./data
EXPOSE 4000
# Default to disabling instrumentation, can be overridden to false in
# docker invocations to reenable.
ENV OTEL_SDK_DISABLED=true
# TODO remove custom entrypoint when EDOT Python >0.7.0 is released.
RUN echo 'if [ "${OTEL_SDK_DISABLED:-true}" == "false" ]; \
then \
opentelemetry-instrument $@; \
else \
exec $@; \
fi' > entrypoint.sh
ENTRYPOINT [ "bash", "-eu", "./entrypoint.sh" ]
CMD [ "python", "api/app.py" ]