2.1K
Run4j is a powerhouse automation engine designed to execute scripts, workflows, and integrations seamlessly.
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
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
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
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.
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.
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
Variable | Description | Default |
| Database Connection String |
|
| JDBC Driver Class |
|
| Database Username |
|
| Database Password | (empty) |
| Quote all SQL identifiers |
|
| Secret key for JWT signing |
|
| Key for internal variable encryption |
|
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.
Content type
Image
Digest
sha256:a970fb0bb…
Size
282.1 MB
Last updated
8 months ago
docker pull run4j/run4j-community