Deploying a monorepo with docker compose: Help understanding Dokploy build environment & process.
I'm trying to deploy a monorepo (using turbo repo):
project/
├── apps/
│ ├── api/ # NestJS backend application
│ ├── admin/ # React admin interface
│ └── web # nextjs application frontend
│
├── packages/
│ ├── interfaces/ # Shared interfaces and types
│ └── database/ # Shared database configuration
├── .gitignore
├── package.json # Root package.json
├── pnpm-workspace.yaml # PNPM workspace configuration
└── turbo.json # Turborepo configuration
I can successfully build the entire monorepo locally, and using a GitLab CI pipeline without issues. However when I try to build the same repo with Dokploy i get various build errors. Some of the errors were because I have 3 different docker-compose files:
- docker-compose.yaml: Base file that other files inherit from
- docker-compose.override.yaml: override file thats used for development
- docker-compose.prod.yaml: Intended to be used for production.
Dokploys build process doesn't seem to be able to understand the relationship between the files since it gives errors saying 'image is not defined' for some of the containers (they are defined in the base file) so I had to create a 4th docker-compose specifically for it that defines everything.
But the issues continue, especially around building the shared packages. For example when it's building the api it needs to build the database then the interfaces first. The database building succeeds but then the interface fails due to an error about not being able to find the 'database' package even though it was just built in the previous step. Refer to attached image
I just generally want to better understand the Dokploy build environment and how it differs from locally building or building through a CI environment so I can understand the modifications I'd need to make in my Dockerfiles, package.json's or docker-compose.yaml.
project/
├── apps/
│ ├── api/ # NestJS backend application
│ ├── admin/ # React admin interface
│ └── web # nextjs application frontend
│
├── packages/
│ ├── interfaces/ # Shared interfaces and types
│ └── database/ # Shared database configuration
├── .gitignore
├── package.json # Root package.json
├── pnpm-workspace.yaml # PNPM workspace configuration
└── turbo.json # Turborepo configuration
I can successfully build the entire monorepo locally, and using a GitLab CI pipeline without issues. However when I try to build the same repo with Dokploy i get various build errors. Some of the errors were because I have 3 different docker-compose files:
- docker-compose.yaml: Base file that other files inherit from
- docker-compose.override.yaml: override file thats used for development
- docker-compose.prod.yaml: Intended to be used for production.
Dokploys build process doesn't seem to be able to understand the relationship between the files since it gives errors saying 'image is not defined' for some of the containers (they are defined in the base file) so I had to create a 4th docker-compose specifically for it that defines everything.
But the issues continue, especially around building the shared packages. For example when it's building the api it needs to build the database then the interfaces first. The database building succeeds but then the interface fails due to an error about not being able to find the 'database' package even though it was just built in the previous step. Refer to attached image
I just generally want to better understand the Dokploy build environment and how it differs from locally building or building through a CI environment so I can understand the modifications I'd need to make in my Dockerfiles, package.json's or docker-compose.yaml.
