Pre-configured MySQL 8.0 image with the workflow schema automatically initialized. No manual schema creation required.
# Pull the latest image
docker pull ghcr.io/ejc3/workflow-mysql:latest
# Run the container
docker run -d --name workflow-mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_PASSWORD=workflow \
-p 3306:3306 \
ghcr.io/ejc3/workflow-mysql:latestAfter the container starts, the workflow schema will be automatically created in the workflow database.
MYSQL_ROOT_PASSWORD- Root user password (required for container startup)MYSQL_PASSWORD- Password for the workflow user (required)
MYSQL_DATABASE- Database name (default:workflow)MYSQL_USER- Database user (default:workflow)
ghcr.io/ejc3/workflow-mysql:latestAlways points to the most recent build from the main branch.
ghcr.io/ejc3/workflow-mysql:abc1234Each commit to main is tagged with its short SHA (first 7 characters).
ghcr.io/ejc3/workflow-mysql:pr-123Pull requests are tagged with pr-<number> for testing before merge.
Once the container is running, configure your application:
export WORKFLOW_SQL_URL="mysql://workflow:workflow@localhost:3306/workflow"
export WORKFLOW_SQL_DATABASE_TYPE="mysql".env.local:
WORKFLOW_SQL_URL=mysql://workflow:workflow@localhost:3306/workflow
WORKFLOW_SQL_DATABASE_TYPE=mysqlimport { createWorld } from '@workflow/world-sql';
const world = createWorld({
databaseType: 'mysql',
connectionString: 'mysql://workflow:workflow@localhost:3306/workflow'
});
await world.start();The image automatically creates the following tables on first startup:
workflow_runs- Workflow run stateworkflow_events- Event log for replayworkflow_steps- Step execution stateworkflow_hooks- Webhook subscriptionsworkflow_stream_chunks- Streaming data chunksworkflow_jobs- Job queue for workflow execution
version: '3.8'
services:
mysql:
image: ghcr.io/ejc3/workflow-mysql:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: workflow
ports:
- "3306:3306"
volumes:
- workflow-data:/var/lib/mysql
volumes:
workflow-data:Add a volume mount to persist data across container restarts:
docker run -d --name workflow-mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_PASSWORD=workflow \
-p 3306:3306 \
-v workflow-data:/var/lib/mysql \
ghcr.io/ejc3/workflow-mysql:latestdocker run -d --name workflow-mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=myapp \
-e MYSQL_USER=myuser \
-e MYSQL_PASSWORD=mypass \
-p 3306:3306 \
ghcr.io/ejc3/workflow-mysql:latestVerify the database is ready:
docker exec workflow-mysql mysqladmin ping -h localhost -u workflow -pworkflowCheck that tables were created:
docker exec workflow-mysql mysql -u workflow -pworkflow workflow -e "SHOW TABLES;"cd docker/mysql
docker build -t workflow-mysql .
docker run -d --name workflow-mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_PASSWORD=workflow \
-p 3306:3306 \
workflow-mysqlCheck logs for errors:
docker logs workflow-mysqlCommon issues:
- Missing
MYSQL_ROOT_PASSWORDorMYSQL_PASSWORD - Port 3306 already in use
The schema is only created on the first startup of a fresh database. If you're reusing a volume with an existing database, the init script won't run.
To reset:
docker stop workflow-mysql
docker rm workflow-mysql
docker volume rm workflow-data # Remove existing data
# Then start fresh containerWait a few seconds for MySQL to finish initializing:
# Poll until ready
until docker exec workflow-mysql mysqladmin ping -h localhost -u workflow -pworkflow 2>/dev/null; do
echo "Waiting for MySQL..."
sleep 1
done
echo "MySQL is ready!"The image is built for multiple platforms:
linux/amd64(x86_64)linux/arm64(Apple Silicon, ARM servers)
Docker automatically pulls the correct image for your platform.