jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.44k stars 4.02k forks source link

docker-compose for all third party servers for microservice #18840

Closed paris0120 closed 2 years ago

paris0120 commented 2 years ago
Overview of the feature request

I am wondering if it will be helpful if there can be one docker image that includes all the third-party servers (basically, it combines all the app.yml but without individual generated servers when we generate microservice servers.

Motivation for or Use Case

I'm trying to modify the generated servers but I have to either start the supportive servers one-by-one or I can work on one server at a time due to the conflicts of ports from duplicated servers. Currently, I add all servers to the gateway and remove the gateway server from the app.yml and modify the MySQL server, but I feel that it can be helpful if we can have an aggregated third-party docker image for a development environment.

Related issues or PR
mraible commented 2 years ago

If you use the Docker Compose sub-generator, there's one docker-compose.yml file with everything in it.

Rapster commented 2 years ago

More details here: https://www.jhipster.tech/docker-compose/#docker-compose-subgen

Doesn't seem to be working for monolith, i'll open a ticket if problem persists

paris0120 commented 2 years ago

If you use the Docker Compose sub-generator, there's one docker-compose.yml file with everything in it.

Maybe I'm not quite familiar with how to work with docker. Basically what I'm trying to do is to develop with all the third-party servers running. The docker-compose.yml includes all the third-party servers as well as all the microservices. Every time I modify something I have to reboot the whole thing. Also, I don't know if I can debug with the docker image.

What I think might be helpful is a docker with all third party servers without the microservices and gateway like the following so that we can run and debug each microservice from the IDE.

Dev env

gateway-mysql: image: mysql:8.0.28

volumes:

#   - ~/volumes/jhipster/gateway/mysql/:/var/lib/mysql/
environment:
  - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  - MYSQL_DATABASE=gateway
# If you want to expose these ports outside your dev PC,
# remove the "127.0.0.1:" prefix
ports:
  - 127.0.0.1:3306:3306
command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp

gateway-elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.15.2

volumes:

#   - ~/volumes/jhipster/gateway/elasticsearch/:/usr/share/elasticsearch/data/
# If you want to expose these ports outside your dev PC,
# remove the "127.0.0.1:" prefix
ports:
  - 127.0.0.1:9200:9200
  - 127.0.0.1:9300:9300
environment:
  - 'ES_JAVA_OPTS=-Xms1024m -Xmx1024m'
  - 'discovery.type=single-node'

jhipster-registry: image: jhipster/jhipster-registry:v7.3.0 volumes:

vishal423 commented 2 years ago

It's a personal taste of how you like to set up your local env. You don't have to start all services via docker-compose and can choose and run others via IDE/CLI. Ideally, you work on a single service/gateway at a time, and generated project local docker-compose files suffice for running others via docker. You may have to tweak mappings (expose ports, map hostnames, etc) for everything to work together.

If you can come up with a generic solution that can work in all scenarios, then, don't hesitate to improve with PR.

paris0120 commented 2 years ago

It's a personal taste of how you like to set up your local env. You don't have to start all services via docker-compose and can choose and run others via IDE/CLI. Ideally, you work on a single service/gateway at a time, and generated project local docker-compose files suffice for running others via docker. You may have to tweak mappings (expose ports, map hostnames, etc) for everything to work together.

If you can come up with a generic solution that can work in all scenarios, then, don't hesitate to improve with PR.

I'm trying but it's really hard. I have learned Yo and how to overwrite jhipster generator but there is little information on the jhipster generator itself. I have no idea which functions doing what without reading the code. Can you provide me with some suggestions on how to familiarize myself with the generator quickly and how to debug the templates?

DanielFran commented 2 years ago

This is not a bug or feature request and hence this is not the correct forum for this. If you have a question please use Stack Overflow, and tag the question with jhipster. This will help the project to keep a clean issue tracker. Also, Stack Overflow will give your question a larger audience:

Finally, you can also use our chat room on gitter.