SemanticSearchPOC / Dockerfile_Orig
MVPilgrim
fdsa
8b58daa
raw
history blame
3.2 kB
###############################################################################
# Use a specific version of Weaviate
FROM semitechnologies/weaviate:1.23.7 as weaviate
# Set environment variables if needed
ENV WEAVIATE_ORIGIN http://localhost:8080
# Expose the default port for Weaviate
EXPOSE 8080
# Additional configuration or startup scripts can be added here
# For example, copying configuration files or scripts:
# COPY startup.sh /usr/local/bin/startup.sh
# RUN chmod +x /usr/local/bin/startup.sh
# Define the default command
#CMD ["weaviate", "start"]
###############################################################################
# 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
RUN apk add python3.11.5
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
###############################################################################
#python environment and app.
#FROM python:3.11.5
#ENTRYPOINT ["/app/startup.sh"]
#RUN apt-get update && \
# apt-get install -y libc6 && \
# rm -rf /var/lib/apt/lists/*
WORKDIR /app
#RUN ls -l / || ls -l /lib || ls -l /usr || ls -l /usr/lib6 || echo "### An ls failed."
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 /usr/lib64 y
#RUN ls -l /usr/lib64
RUN ln -s /usr/lib64/libc.so.6 /usr/lib64/libc.musl-x86_64.so.1
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 ["/app/startup.sh"]