mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-20 02:58:53 +00:00
fix(compose): add default compose path for raw source type in file editor
This commit is contained in:
@@ -74,6 +74,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => {
|
|||||||
await mutateAsync({
|
await mutateAsync({
|
||||||
composeId,
|
composeId,
|
||||||
composeFile: data.composeFile,
|
composeFile: data.composeFile,
|
||||||
|
composePath: "./docker-compose.yml",
|
||||||
sourceType: "raw",
|
sourceType: "raw",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { gitea } from "./gitea";
|
|||||||
import { github } from "./github";
|
import { github } from "./github";
|
||||||
import { gitlab } from "./gitlab";
|
import { gitlab } from "./gitlab";
|
||||||
import { mounts } from "./mount";
|
import { mounts } from "./mount";
|
||||||
import { projects } from "./project";
|
|
||||||
import { schedules } from "./schedule";
|
import { schedules } from "./schedule";
|
||||||
import { server } from "./server";
|
import { server } from "./server";
|
||||||
import { applicationStatus, triggerType } from "./shared";
|
import { applicationStatus, triggerType } from "./shared";
|
||||||
|
|||||||
@@ -187,13 +187,12 @@ export const createCommand = (compose: ComposeNested) => {
|
|||||||
|
|
||||||
const createEnvFile = (compose: ComposeNested) => {
|
const createEnvFile = (compose: ComposeNested) => {
|
||||||
const { COMPOSE_PATH } = paths();
|
const { COMPOSE_PATH } = paths();
|
||||||
const { env, appName, sourceType } = compose;
|
const { env, composePath, appName } = compose;
|
||||||
const composePath =
|
const composeFilePath =
|
||||||
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
join(COMPOSE_PATH, appName, "code", composePath) ||
|
||||||
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
|
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
||||||
|
|
||||||
const envFilePath = join(dirname(composeFilePath), ".env");
|
const envFilePath = join(dirname(composeFilePath), ".env");
|
||||||
console.log("envFilePath", envFilePath);
|
|
||||||
let envContent = `APP_NAME=${appName}\n`;
|
let envContent = `APP_NAME=${appName}\n`;
|
||||||
envContent += env || "";
|
envContent += env || "";
|
||||||
if (!envContent.includes("DOCKER_CONFIG")) {
|
if (!envContent.includes("DOCKER_CONFIG")) {
|
||||||
@@ -218,10 +217,10 @@ const createEnvFile = (compose: ComposeNested) => {
|
|||||||
|
|
||||||
export const getCreateEnvFileCommand = (compose: ComposeNested) => {
|
export const getCreateEnvFileCommand = (compose: ComposeNested) => {
|
||||||
const { COMPOSE_PATH } = paths(true);
|
const { COMPOSE_PATH } = paths(true);
|
||||||
const { env, appName, sourceType } = compose;
|
const { env, composePath, appName } = compose;
|
||||||
const composePath =
|
const composeFilePath =
|
||||||
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
join(COMPOSE_PATH, appName, "code", composePath) ||
|
||||||
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
|
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
||||||
|
|
||||||
const envFilePath = join(dirname(composeFilePath), ".env");
|
const envFilePath = join(dirname(composeFilePath), ".env");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user