pub struct ServiceConfig {Show 19 fields
pub image: Option<String>,
pub entrypoint: Option<StringOrList>,
pub command: Option<StringOrList>,
pub environment: EnvVars,
pub ports: Vec<String>,
pub volumes: Vec<String>,
pub depends_on: DependsOn,
pub networks: ServiceNetworks,
pub cpus: Option<u32>,
pub mem_limit: Option<String>,
pub restart: Option<String>,
pub dns: DnsConfig,
pub tmpfs: StringOrList,
pub cap_add: Vec<String>,
pub cap_drop: Vec<String>,
pub privileged: bool,
pub labels: Labels,
pub healthcheck: Option<HealthcheckConfig>,
pub working_dir: Option<String>,
}Expand description
A single service in a compose file.
Fields§
§image: Option<String>OCI image reference (e.g., “nginx:latest”).
entrypoint: Option<StringOrList>Override the container entrypoint.
command: Option<StringOrList>Override the container command.
environment: EnvVarsEnvironment variables.
ports: Vec<String>Port mappings (“host:container”).
volumes: Vec<String>Volume mounts (“name:/path” or “/host:/container”).
depends_on: DependsOnServices this service depends on (started first).
networks: ServiceNetworksNetworks to connect to.
cpus: Option<u32>Number of CPUs.
mem_limit: Option<String>Memory limit (e.g., “512m”, “1g”).
restart: Option<String>Restart policy: “no”, “always”, “on-failure”, “unless-stopped”.
dns: DnsConfigCustom DNS servers.
tmpfs: StringOrListtmpfs mounts.
cap_add: Vec<String>Linux capabilities to add.
cap_drop: Vec<String>Linux capabilities to drop.
privileged: boolPrivileged mode.
labels: LabelsCustom labels.
healthcheck: Option<HealthcheckConfig>Health check configuration.
working_dir: Option<String>Working directory inside the container.
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceConfig
impl Debug for ServiceConfig
Source§impl Default for ServiceConfig
impl Default for ServiceConfig
Source§fn default() -> ServiceConfig
fn default() -> ServiceConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ServiceConfig
impl<'de> Deserialize<'de> for ServiceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServiceConfig
impl RefUnwindSafe for ServiceConfig
impl Send for ServiceConfig
impl Sync for ServiceConfig
impl Unpin for ServiceConfig
impl UnsafeUnpin for ServiceConfig
impl UnwindSafe for ServiceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more