-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
47 lines (37 loc) · 1.68 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
# Ubuntu image for building, for compatibility with macOS arm64
FROM eclipse-temurin:21-jdk-jammy AS build
# Set necessary args and environment variables for building phoenixd
# Including pinning commit hash
ARG PHOENIXD_BRANCH=v0.4.2
ARG PHOENIXD_COMMIT_HASH=24b817ae70afe986d73df378777010799269b74e
# Upgrade all packages and install dependencies
RUN apt-get update \
&& apt-get upgrade -y
RUN apt-get install -y --no-install-recommends bash git \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Git pull phoenixd source at specified tag/branch and compile phoenixd
WORKDIR /phoenixd
RUN git clone --recursive --single-branch --branch ${PHOENIXD_BRANCH} -c advice.detachedHead=false \
https://github.com/ACINQ/phoenixd . \
&& test `git rev-parse HEAD` = ${PHOENIXD_COMMIT_HASH} || exit 1 \
&& ./gradlew distTar
# Use Alpine imageas final base image to minimize final image size
FROM eclipse-temurin:21-jre-alpine AS final
# Upgrade all packages and install dependencies
RUN apk update \
&& apk upgrade --no-interactive
RUN apk add --update --no-cache bash
# Create a phoenix group and user
RUN addgroup -S phoenix -g 1000 \
&& adduser -S phoenix -G phoenix -u 1000 -h /phoenix
USER phoenix:phoenix
# Unpack the release
WORKDIR /phoenix
COPY --chown=phoenix:phoenix --from=BUILD /phoenixd/build/distributions/phoenix-*-jvm.tar .
RUN tar --strip-components=1 -xvf phoenix-*-jvm.tar
# Indicate that the container listens on port 9740
EXPOSE 9740
# Expose default data directory as VOLUME
VOLUME [ "/phoenix" ]
# Run the daemon with necessary flags for a detacted daemon mode
ENTRYPOINT ["/phoenix/bin/phoenixd", "--agree-to-terms-of-service", "--http-bind-ip", "0.0.0.0"]