MCPcopy
hub / github.com/Dokploy/dokploy / generateFileMounts

Function generateFileMounts

packages/server/src/utils/docker/utils.ts:654–684  ·  view source on GitHub ↗
(
	appName: string,
	service:
		| ApplicationNested
		| LibsqlNested
		| MongoNested
		| MariadbNested
		| MysqlNested
		| PostgresNested
		| RedisNested,
)

Source from the content-addressed store, hash-verified

652};
653
654export const generateFileMounts = (
655 appName: string,
656 service:
657 | ApplicationNested
658 | LibsqlNested
659 | MongoNested
660 | MariadbNested
661 | MysqlNested
662 | PostgresNested
663 | RedisNested,
664) => {
665 const { mounts } = service;
666 const { APPLICATIONS_PATH } = paths(!!service.serverId);
667 if (!mounts || mounts.length === 0) {
668 return [];
669 }
670
671 return mounts
672 .filter((mount) => mount.type === "file")
673 .map((mount) => {
674 const fileName = mount.filePath;
675 const absoluteBasePath = path.resolve(APPLICATIONS_PATH);
676 const directory = path.join(absoluteBasePath, appName, "files");
677 const sourcePath = path.join(directory, fileName || "");
678 return {
679 Type: "bind" as const,
680 Source: sourcePath,
681 Target: mount.mountPath,
682 };
683 });
684};
685
686export const createFile = async (
687 outputPath: string,

Callers 7

mechanizeDockerContainerFunction · 0.90
buildMysqlFunction · 0.90
buildMongoFunction · 0.90
buildRedisFunction · 0.90
buildLibsqlFunction · 0.90
buildPostgresFunction · 0.90
buildMariadbFunction · 0.90

Calls 1

pathsFunction · 0.90

Tested by

no test coverage detected