MVPilgrim commited on
Commit
9f9f982
·
verified ·
1 Parent(s): 4cbf040

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for development purposes.
2
+ # Read docs/development.md for more information
3
+ # vi: ft=dockerfile
4
+
5
+ ###############################################################################
6
+ # Base build image
7
+ FROM golang:1.21-alpine AS build_base
8
+ RUN apk add bash ca-certificates git gcc g++ libc-dev
9
+ WORKDIR /go/src/github.com/weaviate/weaviate
10
+ ENV GO111MODULE=on
11
+ # Populate the module cache based on the go.{mod,sum} files.
12
+ COPY go.mod .
13
+ COPY go.sum .
14
+ RUN go mod download
15
+
16
+ ###############################################################################
17
+ # This image builds the weaviate server
18
+ FROM build_base AS server_builder
19
+ ARG TARGETARCH
20
+ ARG GITHASH="unknown"
21
+ ARG EXTRA_BUILD_ARGS=""
22
+ COPY . .
23
+ RUN GOOS=linux GOARCH=$TARGETARCH go build $EXTRA_BUILD_ARGS \
24
+ -ldflags '-w -extldflags "-static" -X github.com/weaviate/weaviate/usecases/config.GitHash='"$GITHASH"'' \
25
+ -o /weaviate-server ./cmd/weaviate-server
26
+
27
+ ###############################################################################
28
+ # This creates an image that can be used to fake an api for telemetry acceptance test purposes
29
+ FROM build_base AS telemetry_mock_api
30
+ COPY . .
31
+ ENTRYPOINT ["./tools/dev/telemetry_mock_api.sh"]
32
+
33
+ ###############################################################################
34
+ # This image gets grpc health check probe
35
+ FROM build_base AS grpc_health_probe_builder
36
+ ARG TARGETARCH
37
+ RUN GRPC_HEALTH_PROBE_VERSION=v0.4.22 && \
38
+ 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} && \
39
+ chmod +x /bin/grpc_health_probe
40
+
41
+ ###############################################################################
42
+ # Weaviate (no differentiation between dev/test/prod - 12 factor!)
43
+ FROM alpine AS weaviate
44
+ ENTRYPOINT ["/bin/weaviate"]
45
+ COPY --from=grpc_health_probe_builder /bin/grpc_health_probe /bin/
46
+ COPY --from=server_builder /weaviate-server /bin/weaviate
47
+ RUN apk add --no-cache --upgrade ca-certificates openssl
48
+ RUN mkdir ./modules
49
+ CMD [ "--host", "0.0.0.0", "--port", "8079", "--scheme", "http"]