1 /************************************************************************
2 * Copyright 2022 highstreet technologies GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ************************************************************************/
19 // Config is the entire docker-compose YAML object
22 CommonEnvs map[string]string `yaml:"x-common_env,anchor=common_env"`
23 DuEnv map[string]string `yaml:"x-du_env,anchor=du_env"`
24 RuEnv map[string]string `yaml:"x-ru_env,anchor=ru_env"`
25 TopoEnv map[string]string `yaml:"x-topo_env,anchor=topo_env"`
26 CommonNfs CommonNf `yaml:"x-nf,anchor=common_nf"`
27 Networks map[string]Network
28 Volumes map[string]Volume `yaml:",omitempty"`
29 Services map[string]Service
32 // CommonNf is the common network function alias
33 type CommonNf struct {
34 StopGracePeriod string `yaml:"stop_grace_period"`
35 CapAdd []string `yaml:"cap_add"`
38 // Network is the network YAML object
40 Driver string `yaml:",omitempty"`
41 DriverOpts map[string]string `yaml:"driver_opts,omitempty"`
42 External map[string]string `yaml:",omitempty"`
45 // Volume is the volume YAML object
47 Driver, External string
48 DriverOpts map[string]string `yaml:"driver_opts"`
51 // Service is the service YAML object
53 *Service `yaml:",inline,alias=common_nf"`
54 ContainerName string `yaml:"container_name"`
56 Networks, Ports, Volumes, Command, Links []string `yaml:",omitempty"`
57 VolumesFrom []string `yaml:"volumes_from,omitempty"`
58 DependsOn []string `yaml:"depends_on,omitempty"`
59 CapAdd []string `yaml:"cap_add,omitempty"`
60 Build struct{ Context, Dockerfile string } `yaml:",omitempty"`
61 Environment Env `yaml:"environment"`
65 // Env is the environment YAML object
67 *CommonEnv `yaml:",omitempty,inline,alias=common_env"`
68 *DuEnv `yaml:",omitempty,inline,alias=du_env"`
69 *RuEnv `yaml:",omitempty,inline,alias=ru_env"`
70 *TopoEnv `yaml:",omitempty,inline,alias=topo_env"`
73 // CommonEnv is the common_env anchor
74 type CommonEnv struct {
75 *CommonEnv `yaml:",omitempty,inline,alias=common_env"`
78 // DuEnv is the du_env anchor
80 *DuEnv `yaml:",omitempty,inline,alias=du_env"`
83 // RuEnv is the ru_env anchor
85 *RuEnv `yaml:",omitempty,inline,alias=ru_env"`
88 // TopoEnv is the topo_env anchor
90 *TopoEnv `yaml:",omitempty,inline,alias=topo_env"`