Improvement: get realm from config file
[nonrtric/plt/sme.git] / capifcore / docker-compose.yml
1 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
2 #  ========================================================================
3 #  Licensed under the Apache License, Version 2.0 (the "License");
4 #  you may not use this file except in compliance with the License.
5 #  You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #  Unless required by applicable law or agreed to in writing, software
10 #  distributed under the License is distributed on an "AS IS" BASIS,
11 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #  See the License for the specific language governing permissions and
13 #  limitations under the License.
14 #  ============LICENSE_END=================================================
15 #
16 version: '3.5'
17
18 services:
19   postgres:
20     container_name: postgres_container
21     image: postgres:latest
22     environment:
23       POSTGRES_DB: keycloak
24       POSTGRES_USER: keycloak
25       POSTGRES_PASSWORD: password
26     volumes:
27       - postgres_data:/var/lib/postgresql/data
28     healthcheck:
29       test: "exit 0"
30     ports:
31       - "5432:5432"
32     networks:
33       - capif
34     restart: unless-stopped
35
36   pgadmin:
37     container_name: pgadmin_container
38     image: dpage/pgadmin4
39     environment:
40       PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
41       PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
42       PGADMIN_CONFIG_SERVER_MODE: 'False'
43     volumes:
44        - pgadmin:/var/lib/pgadmin
45
46     ports:
47       - "${PGADMIN_PORT:-5050}:80"
48     networks:
49       - capif
50     restart: unless-stopped
51
52   keycloak:
53     container_name: keycloak
54     image: quay.io/keycloak/keycloak:20.0.3
55     environment:
56       KC_DB: postgres
57       KC_DB_URL_HOST: postgres_container
58       KC_DB_URL_DATABASE: keycloak
59       KC_DB_PASSWORD: password
60       KC_DB_USERNAME: keycloak
61       KC_DB_SCHEMA: public
62       KEYCLOAK_ADMIN: admin
63       KEYCLOAK_ADMIN_PASSWORD: secret
64     ports:
65       - 8080:8080
66     depends_on:
67       - postgres
68     healthcheck:
69       test: curl --fail --silent http://localhost:8180/health/ready 2>&1 || exit 1
70       interval: 10s
71       timeout: 10s
72       retries: 5
73     entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev"]
74     networks:
75       - capif
76
77   capifcore:
78     container_name: sme-capifcore
79     image: capifcore:v1
80     ports:
81       - 8090:8090
82     depends_on:
83       - keycloak
84     entrypoint: ["/capifcore"]
85     networks:
86       - capif
87
88 networks:
89   capif:
90     driver: bridge
91     name: capifnet
92
93 volumes:
94     postgres_data:
95       driver: local
96     pgadmin: