-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
47 lines (31 loc) · 1.24 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
FROM golang:1.19-alpine AS build
COPY . /go/src/github.com/bottlepay/lnmux
RUN cd /go/src/github.com/bottlepay/lnmux \
&& GOOS=linux CGO_ENABLED=0 go install \
github.com/bottlepay/lnmux/cmd/...
### Build an Alpine image
FROM alpine:3.16 as alpine
# Update CA certs
RUN apk add --no-cache ca-certificates && rm -rf /var/cache/apk/*
# Copy over app binary
COPY --from=build /go/bin/lnmuxd /usr/bin/lnmuxd
# SQL migrations need to be packaged along with the app
COPY --from=build /go/src/github.com/bottlepay/lnmux/persistence/migrations/*.sql /app/persistence/migrations/
# Add a user
RUN mkdir -p /app && adduser -D lnmux && chown -R lnmux /app
USER lnmux
WORKDIR /app/
CMD [ "/usr/bin/lnmuxd" ]
### 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=build /go/bin/lnmuxd /usr/bin/lnmuxd
# SQL migrations need to be packaged along with the app
COPY --from=build /go/src/github.com/bottlepay/lnmux/persistence/migrations/*.sql /app/persistence/migrations/
# Add a user
RUN mkdir -p /app && adduser --disabled-login lnmux && chown -R lnmux /app
USER lnmux
WORKDIR /app
CMD [ "/usr/bin/lnmuxd" ]