diff --git a/README.md b/README.md index f5c3266..5380219 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,15 @@ Artifacts are published to a Reposilite server. Add the repository to your Maven - A running instance of `phoenixd` - A valid Lightning address (for test runs) +## Docker +Build and publish the `phoenixd-rest` container image with the Jib Maven plugin: + +```bash +./mvnw deploy -pl phoenixd-rest -am +``` + +This pushes `docker.398ja.xyz/phoenixd-rest` to the registry. See [Docker](docs/how-to/docker.md) for details. + ## Documentation - Reference: [phoenixd REST API](https://phoenix.acinq.co/server/api) - How-to guides: diff --git a/docs/how-to/docker.md b/docs/how-to/docker.md index 5d371c6..5be6a97 100644 --- a/docs/how-to/docker.md +++ b/docs/how-to/docker.md @@ -1,11 +1,20 @@ # Docker -Build and run the `phoenixd-rest` module in a container after packaging the project: +The `phoenixd-rest` module can be containerized and published to `docker.398ja.xyz` +using the [Jib Maven plugin](https://github.com/GoogleContainerTools/jib). + +Build and push the image during the Maven `deploy` phase: + +```bash +./mvnw deploy -pl phoenixd-rest -am +``` + +Jib will publish `docker.398ja.xyz/phoenixd-rest:`. + +To run the pushed image locally: ```bash -mvn -q -pl phoenixd-rest -am package -docker build -t phoenixd-rest ./phoenixd-rest -docker run -p 9740:9740 phoenixd-rest +docker run -p 9740:9740 docker.398ja.xyz/phoenixd-rest: ``` The image uses Java 21 and exposes port `9740`. diff --git a/phoenixd-rest/pom.xml b/phoenixd-rest/pom.xml index fad44c1..998bed7 100644 --- a/phoenixd-rest/pom.xml +++ b/phoenixd-rest/pom.xml @@ -57,6 +57,42 @@ + + + + com.google.cloud.tools + jib-maven-plugin + 3.4.0 + + + gcr.io/distroless/java21 + + + docker.398ja.xyz/phoenixd-rest + + ${project.version} + + + packaged + + + java -jar /app.jar + + + + + + jib-build + deploy + + build + + + + + + + reposilite-releases