Package io.github.cdklabs.projen
Class DockerCompose
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- io.github.cdklabs.projen.Component
-
- io.github.cdklabs.projen.DockerCompose
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:42.739Z") @Stability(Experimental) public class DockerCompose extends Component
(experimental) Create a docker-compose YAML file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDockerCompose.Builder(experimental) A fluent builder forDockerCompose.
-
Constructor Summary
Constructors Modifier Constructor Description DockerCompose(Project project)DockerCompose(Project project, DockerComposeProps props)protectedDockerCompose(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedDockerCompose(software.amazon.jsii.JsiiObjectRef objRef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DockerComposeServiceaddService(String serviceName, DockerComposeServiceDescription description)(experimental) Add a service to the docker-compose file.static IDockerComposeVolumeBindingbindVolume(String sourcePath, String targetPath)(experimental) Create a bind volume that binds a host path to the target path in the container.YamlFilegetFile()(experimental) The Docker Compose file.static IDockerComposeVolumeBindingnamedVolume(String volumeName, String targetPath)(experimental) Create a named volume and mount it to the target path.static IDockerComposeVolumeBindingnamedVolume(String volumeName, String targetPath, DockerComposeVolumeConfig options)(experimental) Create a named volume and mount it to the target path.static IDockerComposeNetworkBindingnetwork(String networkName)(experimental) Create a named network and mount it to the target path.static IDockerComposeNetworkBindingnetwork(String networkName, DockerComposeNetworkConfig options)(experimental) Create a named network and mount it to the target path.static DockerComposeServicePortportMapping(Number publishedPort, Number targetPort)(experimental) Create a port mapping.static DockerComposeServicePortportMapping(Number publishedPort, Number targetPort, DockerComposePortMappingOptions options)(experimental) Create a port mapping.static IDockerComposeServiceNameserviceName(String serviceName)(experimental) Depends on a service name.-
Methods inherited from class io.github.cdklabs.projen.Component
getProject, isComponent, postSynthesize, preSynthesize, synthesize
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
DockerCompose
protected DockerCompose(software.amazon.jsii.JsiiObjectRef objRef)
-
DockerCompose
protected DockerCompose(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
DockerCompose
@Stability(Experimental) public DockerCompose(@NotNull Project project, @Nullable DockerComposeProps props)- Parameters:
project- This parameter is required.props-
-
DockerCompose
@Stability(Experimental) public DockerCompose(@NotNull Project project)- Parameters:
project- This parameter is required.
-
-
Method Detail
-
bindVolume
@Stability(Experimental) @NotNull public static IDockerComposeVolumeBinding bindVolume(@NotNull String sourcePath, @NotNull String targetPath)
(experimental) Create a bind volume that binds a host path to the target path in the container.- Parameters:
sourcePath- Host path name. This parameter is required.targetPath- Target path name. This parameter is required.
-
namedVolume
@Stability(Experimental) @NotNull public static IDockerComposeVolumeBinding namedVolume(@NotNull String volumeName, @NotNull String targetPath, @Nullable DockerComposeVolumeConfig options)
(experimental) Create a named volume and mount it to the target path.If you use this named volume in several services, the volume will be shared. In this case, the volume configuration of the first-provided options are used.
- Parameters:
volumeName- Name of the volume. This parameter is required.targetPath- Target path. This parameter is required.options- volume configuration (default: docker compose defaults).
-
namedVolume
@Stability(Experimental) @NotNull public static IDockerComposeVolumeBinding namedVolume(@NotNull String volumeName, @NotNull String targetPath)
(experimental) Create a named volume and mount it to the target path.If you use this named volume in several services, the volume will be shared. In this case, the volume configuration of the first-provided options are used.
- Parameters:
volumeName- Name of the volume. This parameter is required.targetPath- Target path. This parameter is required.
-
network
@Stability(Experimental) @NotNull public static IDockerComposeNetworkBinding network(@NotNull String networkName, @Nullable DockerComposeNetworkConfig options)
(experimental) Create a named network and mount it to the target path.If you use this named network in several services, the network will be shared. In this case, the network configuration of the first-provided options are used.
- Parameters:
networkName- Name of the network. This parameter is required.options- network configuration.
-
network
@Stability(Experimental) @NotNull public static IDockerComposeNetworkBinding network(@NotNull String networkName)
(experimental) Create a named network and mount it to the target path.If you use this named network in several services, the network will be shared. In this case, the network configuration of the first-provided options are used.
- Parameters:
networkName- Name of the network. This parameter is required.
-
portMapping
@Stability(Experimental) @NotNull public static DockerComposeServicePort portMapping(@NotNull Number publishedPort, @NotNull Number targetPort, @Nullable DockerComposePortMappingOptions options)
(experimental) Create a port mapping.- Parameters:
publishedPort- Published port number. This parameter is required.targetPort- Container's port number. This parameter is required.options- Port mapping options.
-
portMapping
@Stability(Experimental) @NotNull public static DockerComposeServicePort portMapping(@NotNull Number publishedPort, @NotNull Number targetPort)
(experimental) Create a port mapping.- Parameters:
publishedPort- Published port number. This parameter is required.targetPort- Container's port number. This parameter is required.
-
serviceName
@Stability(Experimental) @NotNull public static IDockerComposeServiceName serviceName(@NotNull String serviceName)
(experimental) Depends on a service name.- Parameters:
serviceName- This parameter is required.
-
addService
@Stability(Experimental) @NotNull public DockerComposeService addService(@NotNull String serviceName, @NotNull DockerComposeServiceDescription description)
(experimental) Add a service to the docker-compose file.- Parameters:
serviceName- name of the service. This parameter is required.description- a service description. This parameter is required.
-
getFile
@Stability(Experimental) @NotNull public YamlFile getFile()
(experimental) The Docker Compose file.
-
-