I am trying to run my app as an image in Docker. I need a little bit help about setting it up. Here is my docker-compose.yml
version: '3' services: user-service-app: image: user-service-app container_name: myapp java: image: openjdk:latest container_name: openjdk zoekeeper: image: wurstmeister/zookeeper container_name: zookeeper ports: - "2181:2181" kafka: image: wurstmeister/kafka container_name: kafka ports: - "9092:9092" environment: KAFKA_ADVERTISED_HOST_NAME: localhost KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 mongodb: image: mongo container_name: mongodb ports: - "27017:27017" restart: unless-stopped mysql-db: image: mysql container_name: mysql environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_DATABASE: users_db ports: - "3306:3306" My task is to share it with another person and he will be performing some CRUD operations with the whole image on localhost:8080/ different mappings via Postman... I've already tried to change my String connections with "container-name:3306" and "container-name:27017" but still got Communications link failure when my Spring Boot app starts via Docker image. Is it from the Kafka SERVER_BOOTSTRAP_CONFIG should be also changed with the container name?
https://stackoverflow.com/questions/66701613/docker-compose-properties-with-java-mysql-mongo-kafka March 19, 2021 at 10:06AM
没有评论:
发表评论