-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
45 lines (28 loc) · 1017 Bytes
/
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
FROM golang:1.23.3-alpine as base
WORKDIR /root
RUN apk add git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Build service in seperate stage.
FROM base as builder
RUN go build
# Test build.
FROM base as testing
RUN apk add build-base
CMD go vet ./... && go test ./...
# Development build.
FROM base as development
RUN ["go", "install", "github.com/githubnemo/CompileDaemon@latest"]
EXPOSE 9012
CMD CompileDaemon -log-prefix=false -build="go build" -command="./openslides-vote-service"
# Productive build
FROM scratch
LABEL org.opencontainers.image.title="OpenSlides Vote Service"
LABEL org.opencontainers.image.description="The OpenSlides Vote Service handles the votes for electronic polls."
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/OpenSlides/openslides-vote-service"
COPY --from=builder /root/openslides-vote-service .
EXPOSE 9013
ENTRYPOINT ["/openslides-vote-service"]
HEALTHCHECK CMD ["/openslides-vote-service", "health"]