Skip to content

Template Proposal #11

Description

@amustapha

Spinning up server's can be quite a repetitive task especialy when you have multiple servers. As someone using dokploy to manage about 6 projects, I'm proposing creating a serverless-yaml style deployment file that can be used to manage a project.

The idea is to be able to do something like dokploy deploy and it would load dokploy.yaml by default or a user can pass in a flag to specify the deployment file. Then we're able to deploy each service with convig like setting swarm mode, number of replicas, domains etc.

Proposed format

project: uber-clone-project

services:
  - name: geofencer
    image: ghrc.io/geofencer:latest
    replicas: 2
    port: 3000
    domains:
      - hose: geofencer.example.com
      - host: example.com
        path: /v1/geofencer
        tls: true
        redirectToHttps: true
        stripPrefix: true
    env:
      NODE_ENV: production
      API_URL: https://api.example.com
      IP_ADDRESS: ${{project.IP_ADDRESS}}
    resources:
      cpu: 500m
      memory: 512Mi
    configs:
      restart: unless-stopped
      pullPolicy: Always

  - name: backend
    image: dockerub-user/backend:latest
    replicas: 1
    port: 8000
    domains:
      - host: api.example.com
        path: /v1
        tls: true
        stripPrefix: true
    env:
      NODE_ENV: production
      DB_URL: postgres://user:pass@db:5432/mydb
    resources:
      cpu: 300m
      memory: 256Mi
    configs:
      restart: unless-stopped
      pullPolicy: Always

  - name: worker
    image: dockerhub-user/worker:latest
    replicas: 1
    env:
      QUEUE: jobs
      CONCURRENCY: "5"
    resources:
      cpu: 200m
      memory: 256Mi
    configs:
      restart: on-failure

just off the top of my head, if the project doesn't already exist, it should create a new project and use it, if project exists... it should use it.

What are your thoughts?

Activity

  1. Siumauricio commented on Dec 8, 2025

    @Siumauricio
    Contributor

    Hey, that sounds like a good idea, but it would require quite a bit of work since a good structural design needs to be done from the beginning to prevent breaking changes. Later on, I plan to provide a dokploy.json file or something similar to define complex structures or even run bash commands.

  2. amustapha commented on Dec 8, 2025

    @amustapha
    Author

    Upon scratching deeper, I figured I'm able to get this to work with docker-compose.yml. I was able to build a prototype for this but it overlaps a lot wirh docker compose.

    The only thing I'd want to solve for in future if i have then bandwidth is adding the domains to the domains tab when added as a traefik label. Currently unless I open the docker compose (or environment if configurable with dynamic domain) I can't recall what domain is added to which service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions