Sign inSign up

run4j/run4j-community

By run4j

•Updated 8 months ago

Image
API management
Internet of things
Developer tools
1

2.1K

run4j/run4j-community repository overview

⁠Run4J Community Edition

Run4j is a powerhouse automation engine designed to execute scripts, workflows, and integrations seamlessly.

⁠Prerequisites: Prepare Host Environment

Before running the container, you must create the persistent volume directories on your host machine:

sudo mkdir -p /var/run4j/volumes/my-app/db
sudo mkdir -p /var/run4j/volumes/my-app/maven
sudo mkdir -p /var/run4j/volumes/my-app/datasource
# Optional: Ensure the container has write permissions
sudo chmod -R 777 /var/run4j/volumes/my-app

⁠Quick Start

To ensure high availability, use the --restart always flag. This ensures the container restarts automatically if it crashes or if the Docker daemon/server restarts.

docker run -d \
  --name run4j-app \
  --restart always \
  --tmpfs /tmp:exec,mode=1777 \
  -v /var/run4j/volumes/my-app/db:/app/db:Z \
  -v /var/run4j/volumes/my-app/maven:/app/maven:Z \
  -v /var/run4j/volumes/my-app/datasource:/app/datasource:Z \
  -p 9090:8080 \
  docker.io/run4j/run4j-community:latest

⁠2. Standard Mode (Compatible with Docker Desktop)
docker run -d \
  --restart unless-stopped \
  -p 9090:8080 \
  -v /var/run4j/volumes/my-app/db:/app/db:Z \
  -v /var/run4j/volumes/my-app/maven:/app/maven:Z \
  -v /var/run4j/volumes/my-app/datasource:/app/datasource:Z \
  docker.io/run4j/run4j-community:latest

⁠Persistent Volumes

The application uses specific directories for storage and extensibility. It is highly recommended to mount these to your host machine:

  • /app/db: Stores the H2 database or SQLite files. Mapping this ensures your data survives container restarts.

  • /app/maven: A directory for external JARs, plugins, or shared libraries that the application needs to load at runtime.

  • /app/datasource: Used for dynamic datasource configurations or external property files.

⁠External PostgreSQL Connection

If you want to connect to a PostgreSQL database running outside of Docker (e.g., on your host machine or a remote cloud server), use the following environment variables.

⁠Connecting to a Database on the Host Machine
docker run -d \
  --name run4j-app \
  --restart always \
  --tmpfs /tmp:exec,mode=1777 \
  -v /var/run4j/volumes/my-app/db:/app/db:Z \
  -v /var/run4j/volumes/my-app/maven:/app/maven:Z \
  -v /var/run4j/volumes/my-app/datasource:/app/datasource:Z \
  -p 9090:8080 \
  -e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/your_db_name \
  -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver \
  -e SPRING_DATASOURCE_USERNAME=postgres \
  -e SPRING_DATASOURCE_PASSWORD=your_password \
  -e SPRING_JPA_PROPERTIES_HIBERNATE_GLOBALLY_QUOTED_IDENTIFIERS=true \
  docker.io/run4j/run4j-community:latest

services:
  db:
    image: postgres:15
    restart: always
    environment:
      POSTGRES_DB: run4j_db
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: secretpassword
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U admin -d run4j_db"]
      interval: 5s
      timeout: 5s
      retries: 5

run4j: image: docker.io/run4j/run4j-community:latest restart: always ports: - "9090:8080" tmpfs: - /tmp:exec,mode=1777 volumes: - /var/run4j/volumes/my-app/db:/app/db:Z - /var/run4j/volumes/my-app/maven:/app/maven:Z - /var/run4j/volumes/my-app/datasource:/app/datasource:Z environment: - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/run4j_db - SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver - SPRING_DATASOURCE_USERNAME=admin - SPRING_DATASOURCE_PASSWORD=secretpassword - SPRING_JPA_HIBERNATE_DDL_AUTO=update - SPRING_JPA_PROPERTIES_HIBERNATE_GLOBALLY_QUOTED_IDENTIFIERS=true - JWT_SECRET=YourCustomSecureJWTSecretAtLeast32Chars depends_on: db: condition: service_healthy

⁠Configuration (Environment Variables)

Variable

Description

Default

SPRING_DATASOURCE_URL

Database Connection String

jdbc:h2:file:./db/run4j

SPRING_DATASOURCE_DRIVER_CLASS_NAME

JDBC Driver Class

org.h2.Driver

SPRING_DATASOURCE_USERNAME

Database Username

sa

SPRING_DATASOURCE_PASSWORD

Database Password

(empty)

SPRING_JPA_PROPERTIES_HIBERNATE_GLOBALLY_QUOTED_IDENTIFIERS

Quote all SQL identifiers

false

JWT_SECRET

Secret key for JWT signing

MySuperSecretKey...

APP_SECRET_KEY

Key for internal variable encryption

f84ac4e5...

⁠Security Notes

  • SELinux: The :Z suffix in volume mounts ensures correct SELinux context labeling for shared volumes.

  • Auto-Restart: Using --restart always is standard for production to ensure the service remains up after a crash or system reboot.

  • Production: Always change the JWT_SECRET and APP_SECRET_KEY when deploying to production.

Developed by Maniac4j Group. Powered by Spring Boot 4.0.0 & Java 25.

https://run4j.com/⁠

Tag summary

Content type

Image

Digest

sha256:a970fb0bb…

Size

282.1 MB

Last updated

8 months ago

docker pull run4j/run4j-community