Skip to content
Go back

Deploying a Multi-Container App on Dokploy

Deploying a Multi-Container App on Dokploy

Introduction

Multi-container applications often include a web server, database, and cache. This guide shows how to deploy them on Dokploy using Docker Compose.

Prerequisites

Step 1: Create Docker Compose

docker-compose.yml:

version: "3.8"
services:
  web:
    build: ./web
    ports:
      - "80:80"
    depends_on:
      - db
      - redis

  db:
    image: postgres:15
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
      POSTGRES_DB: mydb
    volumes:
      - db-data:/var/lib/postgresql/data

  redis:
    image: redis:7
    ports:
      - "6379:6379"

volumes:
  db-data:

Step 2: Dokploy Config

dokploy.yaml:

apps:
  myapp:
    docker_compose: docker-compose.yml
    env:
      NODE_ENV: production
    volumes:
      - db-data:/var/lib/postgresql/data
volumes:
  db-data:

Step 3: Deploy

git remote add dokploy dokploy@server:myapp
git push dokploy main

Dokploy will deploy all services, handle dependencies, and orchestration.

Summary

Deploying multi-container apps on Dokploy is straightforward with docker_compose. Services are built, started, and linked automatically.


Share this post on:

Previous Post
Using Docker Secrets for Managing Credentials
Next Post
Integrating Strapi 5 with Cloudinary for Media Handling