docker-compose

Spring Boot containers can not connect to the Kafka container

别来无恙 提交于 2020-12-04 21:03:26
问题 I'm trying to use microservices Spring Boot with Kafka , but my Spring Boot containers can not connect to the Kafka container. docker-compose.yml : version: '3' services: zookeeper: image: wurstmeister/zookeeper container_name: zookeeper restart: always ports: - 2181:2181 kafka: image: wurstmeister/kafka container_name: kafka restart: always ports: - 9092:9092 depends_on: - zookeeper links: - zookeeper:zookeeper environment: KAFKA_ADVERTISED_HOST_NAME: localhost KAFKA_ZOOKEEPER_CONNECT:

Docker Compose Wait til dependency container is fully up before launching

你说的曾经没有我的故事 提交于 2020-12-01 09:43:05
问题 I'm working with a docker service using docker-compose, and I have a service that depends on anther. I've used the depends_on key, but the service with the dependency launches prior to the depending service being completely up. version: '3' services: KeyManager: image: cjrutherford/keymanager deploy: replicas: 1 ports: - '3220:3220' networks: - privnet YellowDiamond: image: cjrutherford/server depends_on: - KeyManager deploy: replicas: 1 ports: - '3000:3000' networks: - privnet - web networks

Docker Compose Wait til dependency container is fully up before launching

不羁岁月 提交于 2020-12-01 09:41:47
问题 I'm working with a docker service using docker-compose, and I have a service that depends on anther. I've used the depends_on key, but the service with the dependency launches prior to the depending service being completely up. version: '3' services: KeyManager: image: cjrutherford/keymanager deploy: replicas: 1 ports: - '3220:3220' networks: - privnet YellowDiamond: image: cjrutherford/server depends_on: - KeyManager deploy: replicas: 1 ports: - '3000:3000' networks: - privnet - web networks

Docker-compose, conditional statements? (e.g. add volume only if condition)

眉间皱痕 提交于 2020-12-01 08:03:13
问题 I want to add a volume to my service, but only if the final user gave a folder for it. Otherwise, no volume should be mounted, for the already-prepared image has valid data in a default folder. That is, I want to do something like (pseudocode): services: my_awesome_service: volumes: if ${VARIABLE} => ${VARIABLE}:/app/folder Are such conditional statements definable in a docker-compose file? The only way I see to make this possible is to first define a base docker-compose file, which does not

Remove a named volume with docker-compose?

放肆的年华 提交于 2020-11-30 06:12:50
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible

Remove a named volume with docker-compose?

Deadly 提交于 2020-11-30 06:12:43
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible

Remove a named volume with docker-compose?

好久不见. 提交于 2020-11-30 06:12:40
问题 If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up creates a named volume for db-data . Is there a way to remove this volume via docker-compose ? If it were an anonymous volume, then docker-compose rm -v postgres would do the trick. But as it stands, I don't know how to remove the db-data volume without reverting to docker commands. It feels like this should be possible

PHP extension unavailable to composer container in docker-compose

怎甘沉沦 提交于 2020-11-27 01:32:19
问题 I use docker-compose and have a number of containers in one project: Nginx, PHP, Composer and nginx. All works well except for one thing: composer does not work. I am trying to install a composer project that uses the GD extension, which is installed in PHP (confirmed using php -m inside the PHP container). However, the composer container does not "see" this extension and complaints it does not exist. How can I link those two? docker-compose.yml: version: '2' services: web: image: nginx:1.15