docker-compose.template 3.0 KB
Newer Older
D
Daming 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<#--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
17
version: '2.1'
18 19 20 21 22

networks:
   default:
     name: ${network_name}

D
Daming 已提交
23 24
services:
    ${docker_container_name}:
25
        image: ${docker_image_name}:${docker_image_version}
26 27 28 29
        <#if hostname??>
        hostname: ${hostname}
        </#if>
        <#if links??>
D
Daming 已提交
30 31 32 33 34 35
        links:
        <#list links as link>
            - ${link}
        </#list>
        </#if>
        environment:
36
        <#if environments??>
37 38 39 40
        <#list environments as env>
            - ${env}
        </#list>
        </#if>
A
Alan Lau 已提交
41
        <#if start_script??>
42
            - SCENARIO_START_SCRIPT=${start_script}
A
Alan Lau 已提交
43
        </#if>
44 45 46 47
            - SCENARIO_NAME=${scenario_name}
            - SCENARIO_VERSION=${scenario_version}
            - SCENARIO_ENTRY_SERVICE=${entry_service}
            - SCENARIO_HEALTH_CHECK_URL=${health_check}
D
Daming 已提交
48
        volumes:
49 50 51 52 53 54 55 56
            - ${agent_home}:/usr/local/skywalking/scenario/agent
            - ${scenario_home}:/usr/local/skywalking/scenario
        <#if depends_on??>
        depends_on:
        <#list depends_on as item>
            - ${item}
        </#list>
        </#if>
D
Daming 已提交
57 58
<#list services as service>
    ${service.name}:
59 60 61
        image: ${service.imageName}
        hostname: ${service.hostname}
        <#if service.volumes??>
D
Daming 已提交
62 63 64 65 66
        volumes:
        <#list service.volumes as volume>
            - ${volume}
        </#list>
        </#if>
Z
zhangwei 已提交
67
        <#if service.environment??>
68
        environment:
Z
zhangwei 已提交
69
        <#list service.environment as environment>
D
Daming 已提交
70 71 72
            - ${environment}
        </#list>
        </#if>
73
        <#if service.expose??>
D
Daming 已提交
74 75 76 77 78
        expose:
        <#list service.expose as expose>
            - ${expose}
        </#list>
        </#if>
79 80 81 82 83 84
        <#if service.startScript??>
        command:
        <#list service.startScript as startScript>
            - ${startScript}
        </#list>
        </#if>
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
        <#if service.depends_on??>
        depends_on:
        <#list service.depends_on as item>
            - ${item}
        </#list>
        </#if>
        <#if service.entrypoint??>
        entrypoint:
        <#list service.entrypoint as item>
            - ${item}
        </#list>
        </#if>
        <#if service.healthcheck??>
        healthcheck:
        <#list service.healthcheck as item>
100
            ${item}
101 102
        </#list>
        </#if>
D
Daming 已提交
103
</#list>