File size: 3,828 Bytes
9f9f982
ae34f8b
9f9f982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ce0a6f
 
9f9f982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1a04247
9f9f982
 
761dd6d
9f9f982
 
b4c28e6
889ac4e
bcf4609
cd698e9
152e6be
1a04247
 
 
 
 
e6f73c6
1a04247
 
 
 
1646215
 
e6f73c6
 
77b7a80
e179858
0420343
 
e179858
 
 
59221d1
 
e179858
152e6be
 
77b7a80
1a04247
e6f73c6
1a04247
 
 
 
 
 
 
96d40b1
e6f73c6
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Dockerfile for development purposes.
# Read docs/development.md for more information.
# vi: ft=dockerfile

###############################################################################
# Base build image
FROM golang:1.21-alpine AS build_base
RUN apk add bash ca-certificates git gcc g++ libc-dev
WORKDIR /go/src/github.com/weaviate/weaviate
ENV GO111MODULE=on
# Populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
RUN go mod download

###############################################################################
# This image builds the weaviate server
FROM build_base AS server_builder
ARG TARGETARCH
ARG GITHASH="unknown"
ARG EXTRA_BUILD_ARGS=""
COPY . .
RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build $EXTRA_BUILD_ARGS \
      -a -ldflags '-w -extldflags "-static" -X github.com/weaviate/weaviate/usecases/config.GitHash='"$GITHASH"'' \
      -o /weaviate-server ./cmd/weaviate-server

###############################################################################
# This creates an image that can be used to fake an api for telemetry acceptance test purposes
FROM build_base AS telemetry_mock_api
COPY . .
ENTRYPOINT ["./tools/dev/telemetry_mock_api.sh"]

###############################################################################
# This image gets grpc health check probe
FROM build_base AS grpc_health_probe_builder
ARG TARGETARCH
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.22 && \
      wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} && \
      chmod +x /bin/grpc_health_probe

###############################################################################
# Weaviate (no differentiation between dev/test/prod - 12 factor!)
FROM alpine AS weaviate
#ENTRYPOINT ["/bin/weaviate"]
COPY --from=grpc_health_probe_builder /bin/grpc_health_probe /bin/
COPY --from=server_builder /weaviate-server /bin/weaviate
RUN chmod 755 /bin/weaviate
RUN apk add --no-cache --upgrade ca-certificates openssl
RUN mkdir ./modules
RUN mkdir -p /var/lib/weaviate/data
RUN chmod -R 777 /var
ENV AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED true
ENV PERSISTENCE_DATA_PATH /var/lib/weaviate/data
#ENV ENABLE_MODULES text2vec-transformers
#CMD [ "--host", "0.0.0.0", "--port", "8080", "--scheme", "http", ""]

###############################################################################
# python environment and app.
FROM python:3.11.5
ENTRYPOINT ["/app/startup.sh"]
RUN apt update
WORKDIR /app

COPY ./requirements.txt /app/requirements.txt
COPY ./semsearch.py     /app/semsearch.py
COPY ./startup.sh       /app/startup.sh
RUN  chmod 755          /app/startup.sh

COPY --from=weaviate /bin/weaviate /app/weaviate
COPY --from=weaviate ./modules ./
COPY --from=server_builder /lib/libc.musl-x86_64.so.1 /lib
RUN  mkdir -p /var/lib/weaviate/data y
RUN  chmod -R 777 /var
COPY --from=weaviate /var/lib/weaviate/data /var/lib/weaviate/data
ENV AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED true
ENV AUTHENTICATION_OIDC_ENABLED false
ENV AUTHENTICATION_APIKEY_ENABLED false
ENV PERSISTENCE_DATA_PATH /var/lib/weaviate/data
#ENV ENABLE_MODULES text2vec-transformers
#ENV TRANSFORMERS_INFERENCE_API "http://127.0.0.1:999"

RUN mkdir -p /app/inputDocs
COPY ./inputDocs/*      /app/inputDocs

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
RUN pip install https://files.pythonhosted.org/packages/13/87/e0cb08c2d4bd7d38ab63816b306c8b1e7cfdc0e59bd54462e8b0df069078/semantic_text_splitter-0.6.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
RUN pip show semantic-text-splitter
RUN useradd -m -u 1000 user

##############################################################################
# Start the weaviate vector database and the semantic search  app.
#RUN /app/startup.sh
CMD []