diff --git a/src/containers/apps/oneclick/OneClickAppDeploymentHelper.ts b/src/containers/apps/oneclick/OneClickAppDeploymentHelper.ts index 953cb7c3..02bcf8dd 100644 --- a/src/containers/apps/oneclick/OneClickAppDeploymentHelper.ts +++ b/src/containers/apps/oneclick/OneClickAppDeploymentHelper.ts @@ -91,7 +91,7 @@ export default class OneClickAppDeploymentHelper { }) const overrideYaml = - DockerComposeToServiceOverride.convertComposeToService( + DockerComposeToServiceOverride.convertUnconsumedComposeParametersToServiceOverride( dockerComposeService ) diff --git a/src/utils/DockerComposeToServiceOverride.ts b/src/utils/DockerComposeToServiceOverride.ts index 1ec1c109..a9d1b0c0 100644 --- a/src/utils/DockerComposeToServiceOverride.ts +++ b/src/utils/DockerComposeToServiceOverride.ts @@ -3,17 +3,23 @@ import { IDockerComposeService } from '../models/IOneClickAppModels' import Utils from './Utils' export default class DockerComposeToServiceOverride { - static convertComposeToService(compose: IDockerComposeService) { - // NOTE: - // Port, replicas, env vars, volumes, and image are supplied through CapRover definition - // network will be set to captain-overlay - // restart_policy is not generally needed, by default docker services restart automatically - // ---- - // Only parse parameters that are not from the aforementioned list. - // The only useful parameter that we are parsing at the moment is hostname: https://github.com/caprover/caprover/issues/404 - + /** + * Converts the unsupported docker compose parameters to CapRover service override definition. + * Port, replicas, env vars, volumes, and image are supplied through CapRover definition, + * network will be set to captain-overlay restart_policy is not generally needed, + * by default docker services restart automatically. + * Only parse parameters that are not from the aforementioned list. + * The only useful parameter that we are parsing at the moment is hostname: https://github.com/caprover/caprover/issues/404 + * + * @param docker compose service definition + * @returns the override service definition in yaml format + */ + static convertUnconsumedComposeParametersToServiceOverride( + compose: IDockerComposeService + ) { const overrides = [] as any[] overrides.push(DockerComposeToServiceOverride.parseHostname(compose)) + // Add more overrides here if needed let mergedOverride = {} as any overrides.forEach((o) => {