Using Docker Compose locally, deploying to StackBlaze
6 min readUpdated April 2026
Docker Compose is great for local development. StackBlaze lets you take that same docker-compose.yml and import it directly, each service in the file becomes a standalone StackBlaze service with its own Git-connected build pipeline, private networking, and persistent storage.
You don’t have to rewrite your infrastructure description. The import command reads the Compose spec, maps service types intelligently, and presents you with a review screen before anything is provisioned.
›âœ“Ready to import. Run "stackblaze import compose --apply" to proceed.
Service type mapping
Compose key
StackBlaze service
build: .
Web Service (Dockerfile)
image: postgres:16
PostgreSQL Database
image: redis:7-alpine
Redis Cache
volumes:
Persistent Disk (PVC)
environment:
Environment Variables / Secrets
Import flow
Under the hood
The Compose importer translates the declarative Compose spec into StackBlaze’s internal resource model, which then synthesises Kubernetes manifests for each service:
image / build: services with a build key become Web Services using your Dockerfile. Services with a known image (postgres, redis, mysql) map to managed StackBlaze databases.
volumes: named volumes become PersistentVolumeClaims sized at 10 GB by default. You can resize in the dashboard after import.
environment: plain string values become Kubernetes ConfigMap entries; values containing the word “secret”, “password”, or “token” are promoted to Secrets automatically.
networks: Compose’s default network is replaced by Kubernetes ClusterIP Services. Each service is reachable at its Compose service name as the hostname within the project namespace.
Step by step
01
Write your docker-compose.yml as usual
There's nothing special to add. Use the standard Compose spec you're already familiar with, define services, set build context or image, map ports, declare volumes, and wire services together with the depends_on key. StackBlaze understands Compose v3.x syntax.
02
Run stackblaze import compose
Install the StackBlaze CLI (npm i -g @stackblaze/cli) and run "stackblaze import compose" from the directory containing your docker-compose.yml. The CLI parses the file, resolves service dependencies, and sends the manifest to StackBlaze's API. You'll see a preview of each service that will be created.
03
Review imported services in the dashboard
Each Compose service appears as a separate StackBlaze service. The dashboard lets you review inferred settings, build command, exposed ports, environment variables, disk mounts, before any resource is provisioned. Edit anything before clicking "Deploy all".
04
Each service gets its own deployment pipeline
After confirmation, each service is connected to GitHub and gets an independent CI/CD pipeline. Pushing to main rebuilds only the services whose source files changed. Services communicate over StackBlaze's private network using their Compose service name as the hostname.