MCPcopy Create free account
hub / github.com/nhost/nhost / ComposeFileFromConfig

Function ComposeFileFromConfig

cli/dockercompose/compose.go:769–837  ·  view source on GitHub ↗
( //nolint:funlen
	cfg *model.ConfigConfig,
	subdomain string,
	projectName string,
	httpPort uint,
	useTLS bool,
	postgresPort uint,
	nhostFolder string,
	dotNhostFolder string,
	rootFolder string,
	ports ExposePorts,
	branch string,
	dashboardVersion string,
	functionsVersion string,
	configserverImage string,
	appID string,
	startFunctions bool,
	caCertificatesPath string,
	runServices ...*RunService,
)

Source from the content-addressed store, hash-verified

767}
768
769func ComposeFileFromConfig( //nolint:funlen
770 cfg *model.ConfigConfig,
771 subdomain string,
772 projectName string,
773 httpPort uint,
774 useTLS bool,
775 postgresPort uint,
776 nhostFolder string,
777 dotNhostFolder string,
778 rootFolder string,
779 ports ExposePorts,
780 branch string,
781 dashboardVersion string,
782 functionsVersion string,
783 configserverImage string,
784 appID string,
785 startFunctions bool,
786 caCertificatesPath string,
787 runServices ...*RunService,
788) (*ComposeFile, error) {
789 services, err := getServices(
790 cfg,
791 subdomain,
792 projectName,
793 httpPort,
794 useTLS,
795 postgresPort,
796 nhostFolder,
797 dotNhostFolder,
798 rootFolder,
799 ports,
800 branch,
801 dashboardVersion,
802 functionsVersion,
803 configserverImage,
804 appID,
805 startFunctions,
806 runServices...,
807 )
808 if err != nil {
809 return nil, err
810 }
811
812 volumes := map[string]struct{}{
813 rootNodeModules(branch): {},
814 "pgdata_" + sanitizeBranch(branch): {},
815 "minio_" + sanitizeBranch(branch): {},
816 "mailhog_" + sanitizeBranch(branch): {},
817 }
818
819 if startFunctions {
820 volumes[functionsNodeModules(branch)] = struct{}{}
821 }
822
823 for _, runService := range runServices {
824 for _, s := range runService.Config.GetResources().GetStorage() {
825 volumes[runVolumeName(runService.Config.Name, s.GetName(), branch)] = struct{}{}
826 }

Callers 1

upFunction · 0.92

Calls 7

getServicesFunction · 0.85
rootNodeModulesFunction · 0.85
sanitizeBranchFunction · 0.85
functionsNodeModulesFunction · 0.85
runVolumeNameFunction · 0.85
mountCACertificatesFunction · 0.85
GetNameMethod · 0.45

Tested by

no test coverage detected