Is a Mysql image strictly necessary in JHipster?

0

I have a project created with Jhipster and I'm about to turn it into production. The generator as such creates a container of the database, in this case Mysql. At the moment of generating the image with Docker and executing it obviously uses an image of the database and creates a container that I am not really using, since the connection to the database is in an external server.

The question is whether I can avoid using an image of the database and how can I do it in the JHipster project?

My question is because a normal Spring boot project can be run without using a database image, and I want to know if a project with Jhipster would also be possible because it would save me a lot of space.

Sorry if I am confused on some of the mentioned topics, I do not have 100% domain of them and any correction or clarification is welcome.

Thank you very much.

    
asked by Joshua Puello 05.07.2018 в 23:13
source

1 answer

1

I solved it in the following way:

The following files are found in the path generated by Jhipster {project} / src / main / docker :

  • app.yml
  • Dockerfile
  • entrypoint.sh
  • {database} .yml
  • sonar.yml

Inside the app.yml file it is only a matter of commenting on the database service and commenting on the configuration line of the datasource within the environment in the application service. For me, the file would be as follows:

  version: '2'
  services:
      administrador-app:
          image: administradorapp
          environment:
              # - _JAVA_OPTIONS=-Xmx512m -Xms256m
              - SPRING_PROFILES_ACTIVE=prod,swagger
              # - SPRING_DATASOURCE_URL=jdbc:mysql://127.0.0.1:3306/reco?useUnicode=true&characterEncoding=utf8&useSSL=false
              - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application
          ports:
              - 8080:8080
  #    administradorapp-mysql:
  #        extends:
  #            file: mysql.yml
  #            service: administradorapp-mysql
    
answered by 06.07.2018 в 18:32