-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
52 lines (36 loc) · 1.29 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM golang:1.23.3-alpine as base
WORKDIR /root
RUN apk add git
COPY go.mod go.sum ./
RUN go mod download
COPY cmd cmd
COPY pkg pkg
# Build service in seperate stage.
FROM base as builder
RUN go build -o openslides-search-service cmd/searchd/main.go
# Test build.
FROM base as testing
RUN apk add build-base
CMD go vet ./... && go test -test.short ./...
# Development build.
FROM base as development
RUN ["go", "install", "github.com/githubnemo/CompileDaemon@latest"]
EXPOSE 9050
COPY entrypoint.sh ./
COPY meta/search.yml .
COPY meta/models.yml .
ENTRYPOINT ["./entrypoint.sh"]
CMD CompileDaemon -log-prefix=false -build="go build -o openslides-search-service cmd/searchd/main.go" -command="./openslides-search-service"
# Productive build
FROM alpine:3
LABEL org.opencontainers.image.title="OpenSlides Search Service"
LABEL org.opencontainers.image.description="The Search Service is a http endpoint where the clients can search for data within Openslides."
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/OpenSlides/openslides-search-service"
COPY entrypoint.sh ./
COPY meta/search.yml .
COPY meta/models.yml .
COPY --from=builder /root/openslides-search-service .
EXPOSE 9050
ENTRYPOINT ["./entrypoint.sh"]
CMD exec ./openslides-search-service