-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
30 lines (21 loc) · 678 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
FROM golang:1.17.1-alpine as builder
WORKDIR /root
COPY ./go.mod ./
COPY ./go.sum ./
RUN go mod download
COPY . .
RUN export GO111MODULE=on && CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o build/casmesh cmd/server/*.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates
RUN apk update -v \
&& apk add bash \
&& apk upgrade -v --no-cache
WORKDIR /root
COPY --from=builder /root/build/casmesh ./
RUN mkdir -p /casmesh/file
VOLUME /casmesh/data
COPY ./docker-entrypoint.sh ./
RUN chmod +x /root/docker-entrypoint.sh
ENTRYPOINT ["/root/docker-entrypoint.sh"]
EXPOSE 4002
CMD ["/root/casmesh", "--raft-address", "0.0.0.0:4002", "/casmesh/data/data"]