File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
packages/server/src/services Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
import { join } from "node:path" ;
2
2
import { paths } from "@dokploy/server/constants" ;
3
3
import { db } from "@dokploy/server/db" ;
4
- import { type apiCreateCompose , compose } from "@dokploy/server/db/schema" ;
5
- import { buildAppName , cleanAppName } from "@dokploy/server/db/schema" ;
4
+ import {
5
+ type apiCreateCompose ,
6
+ buildAppName ,
7
+ cleanAppName ,
8
+ compose ,
9
+ } from "@dokploy/server/db/schema" ;
6
10
import {
7
11
buildCompose ,
8
12
getBuildComposeCommand ,
@@ -516,19 +520,20 @@ export const startCompose = async (composeId: string) => {
516
520
const compose = await findComposeById ( composeId ) ;
517
521
try {
518
522
const { COMPOSE_PATH } = paths ( ! ! compose . serverId ) ;
523
+
524
+ const projectPath = join ( COMPOSE_PATH , compose . appName , "code" ) ;
525
+ const path =
526
+ compose . sourceType === "raw" ? "docker-compose.yml" : compose . composePath ;
527
+ const baseCommand = `docker compose -p ${ compose . appName } -f ${ path } up -d` ;
519
528
if ( compose . composeType === "docker-compose" ) {
520
529
if ( compose . serverId ) {
521
530
await execAsyncRemote (
522
531
compose . serverId ,
523
- `cd ${ join (
524
- COMPOSE_PATH ,
525
- compose . appName ,
526
- "code" ,
527
- ) } && docker compose -p ${ compose . appName } up -d`,
532
+ `cd ${ projectPath } && ${ baseCommand } ` ,
528
533
) ;
529
534
} else {
530
- await execAsync ( `docker compose -p ${ compose . appName } up -d` , {
531
- cwd : join ( COMPOSE_PATH , compose . appName , "code" ) ,
535
+ await execAsync ( baseCommand , {
536
+ cwd : projectPath ,
532
537
} ) ;
533
538
}
534
539
}
You can’t perform that action at this time.
0 commit comments