Run DB script before starting other containers
[integration/csit.git] / scripts / policy / policy-apex-pdp / docker-compose-apex.yml
1 # Copyright (C) 2019 Nordix Foundation.
2 # Modifications Copyright (C) 2019 AT&T Intellectual Property.
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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 version: '2'
16 networks:
17   default:
18     driver: bridge
19 services:
20    mariadb:
21       image: mariadb:10.2.14
22       container_name: mariadb
23       hostname: mariadb
24       command: ['--lower-case-table-names=1', '--wait_timeout=28800']
25       env_file: config/db/db.conf
26       volumes:
27          - ./config/db:/docker-entrypoint-initdb.d
28       ports:
29        - "3306:3306"
30    dmaap:
31       image: dmaap/simulator
32       container_name: dmaap-simulator
33       hostname: dmaap-simulator
34       ports:
35        - "3904:3904"
36    pap:
37       image: nexus3.onap.org:10001/onap/policy-pap
38       container_name: policy-pap
39       depends_on:
40        - mariadb
41        - dmaap
42       hostname: policy-pap
43       volumes:
44          - ./config/pap/:/opt/app/policy/pap/etc/
45    api:
46       image: nexus3.onap.org:10001/onap/policy-api
47       container_name: policy-api
48       depends_on:
49        - mariadb
50       hostname: policy-api
51    apex:
52       image: nexus3.onap.org:10001/onap/policy-apex-pdp
53       container_name: policy-apex-pdp
54       depends_on:
55        - mariadb
56        - dmaap
57        - pap
58       hostname: policy-apex-pdp
59       command: ['/opt/app/policy/apex-pdp/bin/apexOnapPf.sh', '-c', '/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json', '-p', '/opt/app/policy/apex-pdp/etc/onappf/config/topic.properties']
60       volumes:
61          - ./config/apex-pdp/:/opt/app/policy/apex-pdp/etc/onappf/config/
62       ports:
63        - "6969:6969"
64        - "23324:23324"
65    start_dependencies:
66       image: dadarek/wait-for-dependencies
67       environment:
68         TIMEOUT_LENGTH: 60
69       container_name: policy-wait
70       depends_on:
71         - mariadb
72         - dmaap
73       hostname: policy-wait
74       command:
75         mariadb:3306
76         dmaap:3904
77    start_all:
78       image: dadarek/wait-for-dependencies
79       environment:
80         TIMEOUT_LENGTH: 60
81       container_name: policy-wait-all
82       depends_on:
83         - mariadb
84         - dmaap
85         - api
86         - pap
87         - apex
88       hostname: policy-wait-all
89       command:
90         mariadb:3306
91         dmaap:3904
92         api:6969
93         pap:6969
94         apex:6969