Skip to content

Deploying

Deploy a docker-compose stack

Run several services together — web, worker, database, cache — from your docker-compose.yml: one URL, one resource pool, one hourly price.

Updated 4 min read

If your repo has a docker-compose.yml (or compose.yaml), DployHub can run all its services together on the shared plan. When you pick the repo, tick Deploy the whole docker-compose stack and choose which service is public. If the repo only has a compose file, this is selected for you.

How it works

  • Services with build: are built from your repo; services with image: (postgres, redis, …) are downloaded.
  • Services reach each other by name on a private network, e.g. postgres://app:pass@db:5432/app or redis://cache:6379.
  • Only the public service gets your app's URL and HTTPS. Set its port in the wizard (we read it from ports: or expose:).
  • Your environment variables fill ${VARS} in the compose file and are passed to the services we build.
  • Data in named volumes (e.g. a database's data folder) survives every deploy and restart.

Example

yaml
services:
  web:
    build: .
    ports: ["3000:3000"]
    environment:
      DATABASE_URL: postgres://app:${DB_PASSWORD}@db:5432/app
      REDIS_URL: redis://cache:6379
    depends_on: [db, cache]
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: app
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    volumes: ["pgdata:/var/lib/postgresql/data"]
  cache:
    image: redis:7-alpine
volumes:
  pgdata: {}

Add DB_PASSWORD under Environment variables before the first deploy.

Price: one pool for the whole stack

You choose vCPU, memory and storage once, and all services share them — at the same rates as single apps (₹300 per vCPU, ₹150 per GB of memory, ₹6 per GB of storage a month, billed hourly, GST extra). Stacks can go up to 4 vCPU and 8 GB of memory. For example 1 vCPU, 2 GB and 10 GB costs ₹660 a month.

What isn’t allowed on shared servers

  • Host folders (./data:/data bind mounts) — use named volumes.
  • privileged, cap_add, network_mode, pid: host, devices and other host access.
  • Published host ports — ports: is only read to find the public port; everything goes through HTTPS.
  • More than 10 services, and compose secrets/configs (use environment variables).

Updates, rollbacks and databases

Every push builds the services again and restarts the ones that changed — usually a few seconds' interruption for the public service, unlike single apps' zero-downtime switch. If the new version doesn't answer, the previous one is started again. You can roll back to any of the last five deploys. A database you run inside the stack has no automatic backups — export it regularly, or use a hosted database.