mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-20 11:08:46 +00:00
fix(compose): update environment file path handling to support raw source type
This commit is contained in:
@@ -187,12 +187,13 @@ export const createCommand = (compose: ComposeNested) => {
|
|||||||
|
|
||||||
const createEnvFile = (compose: ComposeNested) => {
|
const createEnvFile = (compose: ComposeNested) => {
|
||||||
const { COMPOSE_PATH } = paths();
|
const { COMPOSE_PATH } = paths();
|
||||||
const { env, composePath, appName } = compose;
|
const { env, appName, sourceType } = compose;
|
||||||
const composeFilePath =
|
const composePath =
|
||||||
join(COMPOSE_PATH, appName, "code", composePath) ||
|
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
||||||
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
|
||||||
|
|
||||||
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")) {
|
||||||
@@ -217,10 +218,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, composePath, appName } = compose;
|
const { env, appName, sourceType } = compose;
|
||||||
const composeFilePath =
|
const composePath =
|
||||||
join(COMPOSE_PATH, appName, "code", composePath) ||
|
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
|
||||||
join(COMPOSE_PATH, appName, "code", "docker-compose.yml");
|
const composeFilePath = join(COMPOSE_PATH, appName, "code", composePath);
|
||||||
|
|
||||||
const envFilePath = join(dirname(composeFilePath), ".env");
|
const envFilePath = join(dirname(composeFilePath), ".env");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user