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

Function getServiceContainer

packages/server/src/utils/docker/utils.ts:726–750  ·  view source on GitHub ↗
(
	appName: string,
	serverId?: string | null,
)

Source from the content-addressed store, hash-verified

724};
725
726export const getServiceContainer = async (
727 appName: string,
728 serverId?: string | null,
729) => {
730 try {
731 const filter = {
732 status: ["running"],
733 label: [`com.docker.swarm.service.name=${appName}`],
734 };
735 const remoteDocker = await getRemoteDocker(serverId);
736 const containers = await remoteDocker.listContainers({
737 filters: JSON.stringify(filter),
738 });
739
740 if (containers.length === 0 || !containers[0]) {
741 return null;
742 }
743
744 const container = containers[0];
745
746 return container;
747 } catch (error) {
748 throw error;
749 }
750};
751
752export const getComposeContainer = async (
753 compose: Compose,

Callers 2

runCommandFunction · 0.90
mount.tsFile · 0.90

Calls 1

getRemoteDockerFunction · 0.90

Tested by

no test coverage detected