Self-hosted Stormkit instances provide the flexibility to customize Docker images according to your specific deployment needs. You can build custom images that include additional runtimes, dependencies, tools, or configurations that your applications require.
Stormkit uses mise
(formerly rtx
) to dynamically install and manage runtimes during application deployment. This approach provides several benefits:
It's important to understand the distinction between different types of dependencies:
Runtime Dependencies:
npm
, pip
, cargo
, etc.)mise
configurationBuild-time Dependencies:
Stormkit stores all runtime dependencies in the home folder. To persist these dependencies across upgrades and restarts, you can mount the home directory:
# docker-compose.yml
services:
hosting:
image: ghcr.io/stormkit-io/hosting:latest
volumes:
- hosting:/home/stormkit
# Additional configuration...
workerserver:
image: ghcr.io/stormkit-io/workerserver:latest
volumes:
- workerserver:/home/stormkit
# Additional configuration...
volumes:
hosting:
workerserver:
Before creating custom images, it's important to understand the official Stormkit images available:
ghcr.io/stormkit-io/hosting:latest
ghcr.io/stormkit-io/workerserver:latest
When creating custom images, you can extend these official images:
# For custom hosting image
FROM ghcr.io/stormkit-io/hosting:latest
# Add your customizations here
# For custom workerserver image
FROM ghcr.io/stormkit-io/workerserver:latest
# Add your build tools and dependencies here
Custom images are primarily needed for:
For most runtime dependencies (Node.js versions, npm packages, etc.), Stormkit's dynamic installation via mise
is sufficient and preferred.
FROM ghcr.io/stormkit-io/workerserver:latest
# Switch to root to install system packages
USER root
# Install system packages that require root access
RUN apt-get update && apt-get install -y \
imagemagick \
graphicsmagick \
libvips-dev \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Install custom system tools
RUN wget -O /usr/local/bin/custom-tool https://example.com/custom-tool \
&& chmod +x /usr/local/bin/custom-tool
# Switch back to stormkit user
USER stormkit
# No need to specify the cmd as it will be inherited from the base image
Build your custom image locally:
# Build the image
docker build -t my-custom-stormkit:latest .
Optionally, push it to your registry:
# Tag for your registry
docker tag my-custom-stormkit:latest your-registry.com/my-custom-stormkit:latest
# Push to registry
docker push your-registry.com/my-custom-stormkit:latest
Update your docker-compose.yaml
to use custom images.
hosting:
# Instead of the image, provide the build configuration
# and docker compose will build and use the image instead.
# image: ghcr.io/stormkit-io/hosting:latest
build:
context: .
dockerfile: MyCustomDockerFile
Pass the --build
flag to the up
command and Docker Compose will rebuild the image whenever there is a new version.
docker compose pull && docker compose down hosting workerserver && docker compose up --build -d hosting workerserver
When creating custom images, follow these security best practices:
stormkit
user after root operationsAfter configuring custom images, restart your Stormkit instance for the changes to take effect:
docker compose down workerserver hosting && docker compose up workerserver hosting -d