diff --git a/.env b/.env index 3e4aef9..df8df29 100644 --- a/.env +++ b/.env @@ -1,6 +1,4 @@ # Replace 172.17.0.1 with your Docker Host IP for development! # It should be the docker0 inet address. KEYCLOAK_USER=admin KEYCLOAK_PASSWORD=admin -KAFKA_ADVERTISED_HOST_NAME=172.17.0.1 -KAFKA_ADVERTISED_PORT=9092 diff --git a/README.md b/README.md index 6cfda6c..b178a13 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,26 @@ # wikitolearn-shared-services ## Synopsis -This repository contains WikiToLearn shared services like Keycloak or Apache Kafka. +This repository contains WikiToLearn shared services like Keycloak. Since they are _shared dependencies_ among other architecture services they have to be run once in a development environment. Consiquently, they cannot be specified into `docker-compose.yml` file of their consumers. ## Development We use Docker to speed-up development and setup the environment without any dependency issues. ### Minimum requirements * Docker Engine 17.09.0+ ### How to run It is advisable to run using the `docker-compose.yml` file provided. Run instructions: * Build all docker containers with: `docker-compose build` * Run all docker containers with: `docker-compose up` ## Versioning We use [SemVer](http://semver.org/) for versioning. ## License This project is licensed under the AGPLv3+. See the [LICENSE.md](LICENSE.md) file for details. diff --git a/docker-compose.yml b/docker-compose.yml index fa1f136..226b42c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,51 +1,30 @@ version: '3.4' services: keycloak: image: jboss/keycloak-mysql:3.4.3.Final command: ["-b", "0.0.0.0", "-Djboss.socket.binding.port-offset=1000"] environment: KEYCLOAK_USER: ${KEYCLOAK_USER} KEYCLOAK_PASSWORD: ${KEYCLOAK_PASSWORD} MYSQL_PORT_3306_TCP_ADDR: keycloak-db MYSQL_PORT_3306_TCP_PORT: 3306 MYSQL_DATABASE: keycloak MYSQL_USER: keycloak MYSQL_PASSWORD: keycloak ports: - "9080:9080" - "9443:9443" depends_on: - - zookeeper + - keycloak-db keycloak-db: - image: mysql + image: mariadb:10.1 volumes: - keycloak-db:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: keycloak MYSQL_USER: keycloak MYSQL_PASSWORD: keycloak - zookeeper: - image: wurstmeister/zookeeper - volumes: - - zookeeper-conf:/opt/zookeeper-3.4.9/conf - - zookeeper-data:/opt/zookeeper-3.4.9/data - kafka: - image: wurstmeister/kafka:0.10.1.1 - environment: - KAFKA_ADVERTISED_HOST_NAME: ${KAFKA_ADVERTISED_HOST_NAME} - KAFKA_ADVERTISED_PORT: ${KAFKA_ADVERTISED_PORT} - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_CREATE_TOPICS: courses:1:1,chapters:1:1,pages:1:1 - ports: - - "${KAFKA_ADVERTISED_PORT}:${KAFKA_ADVERTISED_PORT}" - depends_on: - - zookeeper - volumes: - - kafka:/kafka volumes: - kafka: - zookeeper-conf: - zookeeper-data: keycloak-db: