forked from NYDIG-OSS/lndsigner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (29 loc) · 1.05 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
ARG gover=1.20.3
# Build a release binary
FROM golang:$gover AS release-builder
COPY . /go/src/github.com/nydig-oss/lndsigner
RUN cd /go/src/github.com/nydig-oss/lndsigner \
&& CGO_ENABLED=0 go install -buildvcs=false \
github.com/nydig-oss/lndsigner/cmd/...
### Build an Alpine image
FROM alpine:3.17 as alpine
# Update CA certs
RUN apk add --no-cache ca-certificates && rm -rf /var/cache/apk/*
# Copy over app binary
COPY --from=release-builder /go/bin/lndsignerd /usr/bin/lndsignerd
# Add a user
RUN mkdir -p /app && adduser -D lndsignerd && chown -R lndsignerd /app
USER lndsignerd
WORKDIR /app/
CMD [ "/usr/bin/lndsignerd" ]
### Build a Debian image
FROM debian:bullseye-slim as debian
# Update CA certs
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
# Copy over app binary
COPY --from=release-builder /go/bin/lndsignerd /usr/bin/lndsignerd
# Add a user
RUN mkdir -p /app && adduser --disabled-login lndsignerd && chown -R lndsignerd /app
USER lndsignerd
WORKDIR /app
CMD [ "/usr/bin/lndsignerd" ]