Adding docker-compose file for keycloak and postgres DB 35/10835/2
authorychacon <yennifer.chacon@est.tech>
Tue, 4 Apr 2023 13:48:26 +0000 (15:48 +0200)
committerychacon <yennifer.chacon@est.tech>
Tue, 4 Apr 2023 14:42:49 +0000 (16:42 +0200)
Issue-ID: NONRTRIC-856
Signed-off-by: ychacon <yennifer.chacon@est.tech>
Change-Id: I6c59369cc54dc2c67584901755c1a9370b6085dc

capifcore/docker-compose.yml [new file with mode: 0644]

diff --git a/capifcore/docker-compose.yml b/capifcore/docker-compose.yml
new file mode 100644 (file)
index 0000000..da2be5b
--- /dev/null
@@ -0,0 +1,84 @@
+#  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed 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.
+#  ============LICENSE_END=================================================
+#
+version: '3.5'
+
+services:
+  postgres:
+    container_name: postgres_container
+    image: postgres:latest
+    environment:
+      POSTGRES_DB: keycloak
+      POSTGRES_USER: keycloak
+      POSTGRES_PASSWORD: password
+    volumes:
+      - postgres_data:/var/lib/postgresql/data
+    healthcheck:
+      test: "exit 0"
+    ports:
+      - "5432:5432"
+    networks:
+      - capif
+    restart: unless-stopped
+
+  pgadmin:
+    container_name: pgadmin_container
+    image: dpage/pgadmin4
+    environment:
+      PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
+      PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
+      PGADMIN_CONFIG_SERVER_MODE: 'False'
+    volumes:
+       - pgadmin:/var/lib/pgadmin
+
+    ports:
+      - "${PGADMIN_PORT:-5050}:80"
+    networks:
+      - capif
+    restart: unless-stopped
+
+  keycloak:
+    container_name: keycloak
+    image: quay.io/keycloak/keycloak:20.0.3
+    environment:
+      KC_DB: postgres
+      KC_DB_URL_HOST: postgres_container
+      KC_DB_URL_DATABASE: keycloak
+      KC_DB_PASSWORD: password
+      KC_DB_USERNAME: keycloak
+      KC_DB_SCHEMA: public
+      KEYCLOAK_ADMIN: admin
+      KEYCLOAK_ADMIN_PASSWORD: secret
+    ports:
+      - 8080:8080
+    depends_on:
+      - postgres
+    healthcheck:
+      test: curl --fail --silent http://localhost:8180/health/ready 2>&1 || exit 1
+      interval: 10s
+      timeout: 10s
+      retries: 5
+    entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev"]
+    networks:
+      - capif
+
+networks:
+  capif:
+    driver: bridge
+
+volumes:
+    postgres_data:
+      driver: local
+    pgadmin:
\ No newline at end of file