Skip to content

Compose Deploy

Docker Compose deployment is ideal for applications that require multiple cooperating services, such as a web app with a database and cache. Simply provide a docker-compose.yml file, and Piora will deploy the entire stack.

  1. Create a new application in the Piora dashboard
  2. Select “Docker Compose” as the deployment method
  3. Paste or upload your docker-compose.yml
version: "3.8"
services:
web:
image: node:20-alpine
working_dir: /app
volumes:
- ./:/app
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://piora:secret@db:5432/myapp
REDIS_URL: redis://cache:6379
depends_on:
- db
- cache
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: piora
POSTGRES_PASSWORD: secret
POSTGRES_DB: myapp
volumes:
- postgres_data:/var/lib/postgresql/data
cache:
image: redis:7-alpine
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data:
SettingDescription
imageDocker image name and tag
buildBuild configuration from Dockerfile
portsPort mappings
environmentEnvironment variables
volumesPersistent storage
depends_onService startup order
restartRestart policy
deployDeployment settings (replicas, resource limits)

You can set resource limits for each service in the Compose file:

services:
web:
image: node:20-alpine
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
services:
web:
environment:
- NODE_ENV=production
- PORT=3000

You can also set environment variables in the Piora dashboard, which will override values defined in the Compose file. This is especially useful for sensitive information that varies between environments.

The dashboard shows the status, logs, and resource usage of each service in the Compose stack.

You can perform operations on individual services within a Compose stack:

  • Restart a single service
  • View service logs
  • Adjust resource allocation
  • Access container shell

After modifying the Compose file, redeploy from the dashboard. Piora intelligently determines which services need updating, minimizing unnecessary restarts.

version: "3.8"
services:
wordpress:
image: wordpress:6-apache
ports:
- "80:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wp
WORDPRESS_DB_PASSWORD: secret
WORDPRESS_DB_NAME: wordpress
volumes:
- wp_data:/var/www/html
db:
image: mysql:8
environment:
MYSQL_ROOT_PASSWORD: rootsecret
MYSQL_DATABASE: wordpress
MYSQL_USER: wp
MYSQL_PASSWORD: secret
volumes:
- db_data:/var/lib/mysql
volumes:
wp_data:
db_data: