forked from PoC-Consortium/burstcoin
-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #774 from signum-network/feat/docker-updates
Updated Dockerfiles
- Loading branch information
Showing
20 changed files
with
264 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
.github/ | ||
.gradle/ | ||
.idea/ | ||
bin/ | ||
build/ | ||
doc/ | ||
t/ | ||
db/ | ||
target/ | ||
openapi/node_modules/ | ||
temp/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Build the node software | ||
#FROM gradle:7.3.3-jdk11 as builder | ||
FROM amazoncorretto:11-alpine-jdk as builder | ||
RUN apk update && apk upgrade \ | ||
&& apk add --no-cache --update coreutils bind-tools git unzip wget curl nodejs npm \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /signum-node | ||
|
||
COPY . . | ||
|
||
RUN node -v | ||
RUN npm -v | ||
|
||
# Build Signum Node Jar | ||
RUN chmod +x /signum-node/gradlew \ | ||
&& /signum-node/gradlew clean dist jdeps \ | ||
--no-daemon \ | ||
-Pjdeps.recursive=true \ | ||
-Pjdeps.ignore.missing.deps=true \ | ||
-Pjdeps.print.module.deps=true | ||
|
||
# Unpack the build to /signum | ||
RUN unzip -o build/distributions/signum-node.zip -d /signum | ||
|
||
# provide needed update scripts | ||
RUN chmod +x update-phoenix.sh | ||
RUN chmod +x update-classic.sh | ||
COPY update-phoenix.sh /signum/update-phoenix.sh | ||
COPY update-classic.sh /signum/update-classic.sh | ||
|
||
WORKDIR /signum | ||
|
||
# Clean up /signum | ||
RUN rm -rf /signum/signum-node.exe 2> /dev/null || true \ | ||
&& rm -rf /signum/signum-node.zip 2> /dev/null || true | ||
|
||
## Create a custom JRE | ||
RUN $JAVA_HOME/bin/jlink \ | ||
--add-modules $(cat /signum-node/build/reports/jdeps/print-module-deps-main.txt) \ | ||
--strip-debug \ | ||
--no-man-pages \ | ||
--no-header-files \ | ||
--compress=2 \ | ||
--output /jre | ||
|
||
RUN mkdir -p /requirements \ | ||
&& ldd /jre/bin/java | awk 'NF == 4 { system("cp --parents " $3 " /requirements") }' | ||
|
||
# Prepare final image | ||
FROM alpine:3.18 | ||
LABEL name="Signum Node" | ||
LABEL description="This is the official Signum Node image" | ||
LABEL credits="gittrekt,damccull,ohager" | ||
ENV JAVA_HOME=/jre | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
|
||
# minimum required env needed for wallet update scripts on container restarts -> see start-node.sh | ||
RUN apk update && apk upgrade \ | ||
&& apk add --no-cache --update coreutils bind-tools git unzip wget curl bash \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
COPY --from=builder /jre $JAVA_HOME | ||
COPY --from=builder /signum /signum | ||
COPY --from=builder /requirements/ / | ||
|
||
WORKDIR /signum | ||
|
||
VOLUME ["/conf", "/db"] | ||
RUN ln -s /conf /signum/conf | ||
RUN ln -s /db /signum/db | ||
|
||
# We use the bootstrap folder to copy the config files to the host machine in the start-node.sh script | ||
# use one of [h2,mariadb,postgres] | ||
ARG database=h2 | ||
ARG network=mainnet | ||
|
||
# Injectable ports defaulting to mainnet | ||
ARG port_p2p=8123 | ||
ARG port_http=8125 | ||
ARG port_ws=8126 | ||
|
||
RUN mkdir ./bootstrap | ||
COPY conf/logging-default.properties ./bootstrap/logging-default.properties | ||
COPY conf/node-default.properties ./bootstrap/node-default.properties | ||
COPY conf/${network}/node.${database}.properties ./bootstrap/node.properties | ||
|
||
COPY docker/scripts/start-node.sh ./start-node.sh | ||
RUN chmod +x start-node.sh | ||
|
||
# Clean up | ||
RUN rm signum-node.exe 2> /dev/null || true | ||
RUN rm signum-node.zip 2> /dev/null || true | ||
|
||
EXPOSE $port_ws $port_http $port_p2p | ||
|
||
ENTRYPOINT [ "./start-node.sh" ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node.network = signum.net.TestnetNetwork | ||
|
||
#### API SERVER #### | ||
API.Listen = 0.0.0.0 | ||
API.allowed = * | ||
|
||
#### DATABASE #### | ||
# Reduces the database file size dramatically, if on... but needs time on shutdown | ||
Db.H2.DefragOnShutdown = on | ||
# Database connection JDBC url | ||
DB.Url=jdbc:h2:file:/db/signum-test;DB_CLOSE_ON_EXIT=FALSE | ||
DB.Username= | ||
DB.Password= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node.network = signum.net.TestnetNetwork | ||
|
||
#### API SERVER #### | ||
API.Listen = 0.0.0.0 | ||
API.allowed = * | ||
|
||
#### DATABASE #### | ||
|
||
# Database connection JDBC url | ||
# Append ;AUTO_SERVER=TRUE to enable automatic mixed mode access. | ||
DB.Url=jdbc:mariadb://localhost:3306/signum-test?sslMode=DISABLED | ||
DB.Username=root | ||
DB.Password=signum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#### API SERVER #### | ||
API.Listen = 0.0.0.0 | ||
API.allowed = * | ||
|
||
#### DATABASE #### | ||
|
||
DB.Url=jdbc:postgresql://localhost:5432/signum-test?sslMode=disabled | ||
DB.Username=signumnode | ||
DB.Password=s1gn00m_n0d3 |
Oops, something went wrong.