Skip to content

Commit 07368ff

Browse files
committed
fix(compose): add default compose path for raw source type in file editor
1 parent 102a7a0 commit 07368ff

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => {
7474
await mutateAsync({
7575
composeId,
7676
composeFile: data.composeFile,
77+
composePath: "./docker-compose.yml",
7778
sourceType: "raw",
7879
})
7980
.then(async () => {

packages/server/src/db/schema/compose.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { gitea } from "./gitea";
1212
import { github } from "./github";
1313
import { gitlab } from "./gitlab";
1414
import { mounts } from "./mount";
15-
import { projects } from "./project";
1615
import { schedules } from "./schedule";
1716
import { server } from "./server";
1817
import { applicationStatus, triggerType } from "./shared";

packages/server/src/utils/builders/compose.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,12 @@ export const createCommand = (compose: ComposeNested) => {
187187

188188
const createEnvFile = (compose: ComposeNested) => {
189189
const { COMPOSE_PATH } = paths();
190-
const { env, appName, sourceType } = compose;
191-
const composePath =
192-
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
193-
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
190+
const { env, composePath, appName } = compose;
191+
const composeFilePath =
192+
join(COMPOSE_PATH, appName, "code", composePath) ||
193+
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
194194

195195
const envFilePath = join(dirname(composeFilePath), ".env");
196-
console.log("envFilePath", envFilePath);
197196
let envContent = `APP_NAME=${appName}\n`;
198197
envContent += env || "";
199198
if (!envContent.includes("DOCKER_CONFIG")) {
@@ -218,10 +217,10 @@ const createEnvFile = (compose: ComposeNested) => {
218217

219218
export const getCreateEnvFileCommand = (compose: ComposeNested) => {
220219
const { COMPOSE_PATH } = paths(true);
221-
const { env, appName, sourceType } = compose;
222-
const composePath =
223-
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
224-
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
220+
const { env, composePath, appName } = compose;
221+
const composeFilePath =
222+
join(COMPOSE_PATH, appName, "code", composePath) ||
223+
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
225224

226225
const envFilePath = join(dirname(composeFilePath), ".env");
227226

0 commit comments

Comments
 (0)