-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
36 lines (26 loc) · 990 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
# BUILD IMAGE --------------------------------------------------------
FROM golang:1.20-alpine as builder
# Get build tools and required header files
RUN apk add --no-cache build-base
WORKDIR /app
COPY . .
# Build the final node binary
ARG GIT_COMMIT=unknown
ARG XMTP_GO_CLIENT_VERSION=unknown
RUN go build \
-o bin/notifications-server \
-ldflags="-X 'main.GitCommit=$GIT_COMMIT' -X 'main.XMTPGoClientVersion=$XMTP_GO_CLIENT_VERSION'" \
cmd/server/main.go
# ACTUAL IMAGE -------------------------------------------------------
FROM alpine:3.12
LABEL maintainer="[email protected]"
LABEL source="https://github.com/xmtp/example-notification-server-go"
LABEL description="XMTP Example Notification Server"
# color, nocolor, json
ENV GOLOG_LOG_FMT=nocolor
# go-waku default port
EXPOSE 5556
COPY --from=builder /app/bin/notifications-server /usr/bin/
ENTRYPOINT ["/usr/bin/notifications-server"]
# By default just show help if called without arguments
CMD ["--help"]