-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile-cluster
59 lines (44 loc) · 1.8 KB
/
Dockerfile-cluster
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
FROM golang:1.21.3 AS builder
ARG VERSION=8.22.2
ENV VERSION="${VERSION}"
# Default value
# Run `--build-arg BILLING=true` to enable billing
ARG BILLING=false
ENV BILLING="${BILLING}"
# Run `--build-arg HOSTED_BILLING=true` to enable billing for hosted reactivesearch
ARG HOSTED_BILLING=false
ENV HOSTED_BILLING="${HOSTED_BILLING}"
# Run `--build-arg CLUSTER_BILLING=true` to enable billing for clusters
ARG CLUSTER_BILLING=true
ENV CLUSTER_BILLING="${CLUSTER_BILLING}"
# Run `--build-arg OPENSOURCE=true` to build opensource
ARG OPENSOURCE=false
ENV OPENSOURCE="${OPENSOURCE}"
# Run `--build-arg IGNORE_BILLING_MIDDLEWARE=true` to disable billing middleware for testing
ARG IGNORE_BILLING_MIDDLEWARE=false
ENV IGNORE_BILLING_MIDDLEWARE="${IGNORE_BILLING_MIDDLEWARE}"
# Run `--build-arg PLAN_REFRESH_INTERVAL=X` to change the default interval of 1 hour, where 'X' is an integer represent the hours unit
ARG PLAN_REFRESH_INTERVAL=1
ENV PLAN_REFRESH_INTERVAL="${PLAN_REFRESH_INTERVAL}"
# Install tools required for project
# Run `docker build --no-cache .` to update dependencies
RUN apt-get update
RUN apt-get -y install build-essential git
WORKDIR /reactivesearch
# List project dependencies with go.mod and go.sum
COPY go.mod go.sum ./
# Install library dependencies
RUN go mod download
# Copy the entire project and build it
# This layer is rebuilt when a file changes in the project directory
COPY . .
RUN make
# Final stage: Create the running container
FROM debian:bookworm AS final
# Create env folder
RUN mkdir /reactivesearch-data && touch /reactivesearch-data/.env && chmod 777 /reactivesearch-data/.env
# Import the compiled executable from the first stage.
COPY --from=builder /reactivesearch /reactivesearch
WORKDIR /reactivesearch
EXPOSE 8000
ENTRYPOINT ["build/reactivesearch", "--log", "error", "--plugins"]