Skip to content

Build and Registry

This chapter covers building the Java application, creating Docker images, and setting up the private registry.

Maven Build

Build All Modules

bash
export ATLAS_ROOT=/path/to/slaunchx-backend-platform
cd $ATLAS_ROOT
mvn package -DskipTests

This produces JAR files in each module's target/ directory.

Build a Single Module

bash
# Build app-prometheus and its dependencies only
mvn package -DskipTests -am -pl slaunchx-app-prometheus

The -am flag builds required upstream modules automatically.

Module List

ModuleTypeJAR Location
slaunchx-app-prometheusRunnableslaunchx-app-prometheus/target/*.jar
slaunchx-support-emailRunnableslaunchx-support-email/target/*.jar
slaunchx-support-fileRunnableslaunchx-support-file/target/*.jar
slaunchx-support-scheduleRunnableslaunchx-support-schedule/target/*.jar
slaunchx-partner-slashRunnableslaunchx-partner-slash/target/*.jar
slaunchx-partner-stripeRunnableslaunchx-partner-stripe/target/*.jar
slaunchx-support-tron-walletRunnableslaunchx-support-tron-wallet/target/*.jar
slaunchx-support-solana-walletRunnableslaunchx-support-solana-wallet/target/*.jar

Other modules (sdk-, common-) are libraries — they produce JARs but no Docker images.

Docker Image Build

Dockerfile Location

Each runnable module has a Dockerfile at:

deploy/docker/Dockerfile.{module-short-name}

Example: deploy/docker/Dockerfile.app-prometheus

Build an Image

bash
cd $ATLAS_ROOT

# Build app-prometheus image
docker build \
  -f deploy/docker/Dockerfile.app-prometheus \
  -t slaunchx/app-prometheus:dev-latest \
  .

Using the Build Script

The repo includes a helper script that combines Maven build + Docker image:

bash
# Build all modules (Maven + Docker)
ci/local/build.sh

# Build single module
ci/local/build.sh app-prometheus

# Maven only (skip Docker image)
ci/local/build.sh app-prometheus --maven-only

Private Docker Registry

For deployment to remote hosts, push images to a private registry.

Start Registry

bash
docker run -d \
  --name slaunchx-registry \
  --network slaunchx-intra \
  -p 127.0.0.1:5000:5000 \
  -v /home/registry/data:/var/lib/registry \
  -e REGISTRY_AUTH=htpasswd \
  -e REGISTRY_AUTH_HTPASSWD_REALM="SlaunchX Registry" \
  -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
  -v /home/registry/auth:/auth \
  --restart unless-stopped \
  registry:2

Create Registry Credentials

bash
mkdir -p /home/registry/auth
docker run --rm --entrypoint htpasswd \
  httpd:2 -Bbn <username> <password> > /home/registry/auth/htpasswd

Push Images

bash
# Login
docker login localhost:5000

# Tag and push
docker tag slaunchx/app-prometheus:dev-latest \
  localhost:5000/slaunchx/app-prometheus:dev-latest
docker push localhost:5000/slaunchx/app-prometheus:dev-latest

Image Tagging Convention

TagMeaning
dev-latestLatest build from dev branch
dev-{YYYYMMDD}-{HHMMSS}Timestamped build (e.g. dev-20260314-091500)

Registry Cleanup

Old images accumulate. Run garbage collection periodically:

bash
# Delete old tags (keep latest + 4 most recent per module)
# Then run GC
docker exec slaunchx-registry bin/registry garbage-collect \
  /etc/docker/registry/config.yml --delete-untagged

Build Checklist

  • [ ] Maven build succeeds with no errors
  • [ ] Docker images created for all needed modules
  • [ ] Private registry running (if deploying to remote host)
  • [ ] Images pushed to registry

Internal Handbook