Add postgres CSIT tests for Apex-PDP
[policy/docker.git] / compose / docker-compose.postgres.yml
1 #
2 # ===========LICENSE_START====================================================
3 #  Copyright (C) 2023 Nordix Foundation.
4 # ============================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=====================================================
17 #
18 version: '2'
19 services:
20   postgres:
21     image: nexus3.onap.org:10001/library/postgres:${POLICY_POSTGRES_VER}
22     container_name: postgres
23     hostname: postgres
24     command: [ '--idle_in_transaction_session_timeout=28800' ]
25     env_file: config/db-pg/db-pg.conf
26     volumes:
27       - ./config/db-pg:/docker-entrypoint-initdb.d:ro
28     expose:
29       - 5432
30     ports:
31       - 5432:5432
32   policy-db-migrator:
33     image: ${CONTAINER_LOCATION}onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
34     container_name: policy-db-migrator
35     hostname: policy-db-migrator
36     depends_on:
37       - postgres
38     expose:
39       - 6824
40     env_file: config/db-pg/db-pg.conf
41     environment:
42       SQL_DB: policyadmin
43       SQL_HOST: postgres
44       PGPASSWORD: policy_user
45     volumes:
46       - ./config/db-migrator/init_pg.sh:/opt/app/policy/bin/db_migrator_policy_init_pg.sh:ro
47       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
48     entrypoint: /opt/app/policy/bin/wait_for_port.sh
49     command: [
50       '-c',
51       '/opt/app/policy/bin/db_migrator_policy_init_pg.sh',
52       'postgres', '5432'
53     ]
54   simulator:
55     image: ${CONTAINER_LOCATION}onap/policy-models-simulator:${POLICY_MODELS_VERSION}
56     container_name: simulator
57     hostname: simulator
58     networks:
59       default:
60         aliases:
61           - message-router
62           - aai-sim
63           - grpc-sim
64           - sdnc-sim
65           - so-sim
66           - vfc-sim
67     volumes:
68       - ./config/sim-all:/opt/app/policy/simulators/etc/mounted:ro
69       - ./config/sim-all/logback.xml:/opt/app/policy/simulators/etc/mounted/logback.xml:ro
70     expose:
71       - 6666
72       - 6668
73       - 6669
74       - 6670
75       - 3904
76       - 6680
77     ports:
78       - ${DMAAP_PORT}:3904
79   api:
80     image: ${CONTAINER_LOCATION}onap/policy-api:${POLICY_API_VERSION}
81     container_name: policy-api
82     depends_on:
83       - policy-db-migrator
84     hostname: policy-api
85     ports:
86       - ${API_PORT}:6969
87     volumes:
88       - ./config/api/apiParametersPostgres.yaml:/opt/app/policy/api/etc/apiParameters.yaml:ro
89       - ./config/api/logback.xml:/opt/app/policy/api/etc/logback.xml:ro
90       - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
91     entrypoint: ./wait_for_port.sh
92     command: [
93       '-c', './policy-api.sh',
94       'postgres', '5432',
95       'policy-db-migrator', '6824'
96     ]
97   pap:
98     image: ${CONTAINER_LOCATION}onap/policy-pap:${POLICY_PAP_VERSION}
99     container_name: policy-pap
100     depends_on:
101       - postgres
102       - simulator
103       - api
104     hostname: policy-pap
105     ports:
106       - ${PAP_PORT}:6969
107     volumes:
108       - ./config/pap/papParametersPostgres.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
109       - ./config/${PROJECT}/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
110       - ./config/pap/logback.xml:/opt/app/policy/pap/etc/logback.xml:ro
111       - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
112     entrypoint: ./wait_for_port.sh
113     command: [
114       '-c', './policy-pap.sh',
115       'postgres', '5432',
116       'message-router', '3904',
117       'api', '6969'
118     ]
119   apex-pdp:
120     image: ${CONTAINER_LOCATION}onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION}
121     container_name: policy-apex-pdp
122     depends_on:
123       - postgres
124       - simulator
125       - pap
126     hostname: policy-apex-pdp
127     ports:
128       - ${APEX_PORT}:6969
129       - ${APEX_EVENTS_PORT}:23324
130     volumes:
131       - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
132       - ./config/apex-pdp/logback.xml:/opt/app/policy/apex-pdp/etc/logback.xml:ro
133       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
134     entrypoint: /opt/app/policy/bin/wait_for_port.sh
135     command: [
136       '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json',
137       'postgres', '5432',
138       'message-router', '3904',
139       'pap', '6969'
140     ]
141   prometheus:
142     image: ${CONTAINER_LOCATION}prom/prometheus:latest
143     container_name: prometheus
144     hostname: prometheus
145     ports:
146       - ${PROMETHEUS_PORT}:9090
147     volumes:
148       - ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml