Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust docker support in README #27691

Merged
merged 4 commits into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions generators/spring-boot/templates/README.md.jhi.spring-boot.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -329,45 +329,51 @@ sonar.password=admin

For more information, refer to the [Code quality page][].

### Using Docker to simplify development (optional)
### Docker Compose support

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services.
JHipster generates a number of docker-compose configuration files in the [<%- dockerServicesDir %>](<%- dockerServicesDir %>) folder to launch required third party services.

<%_ if (!databaseTypeNo) { _%>
For example, to start a <%= prodDatabaseType %> database in a docker container, run:
For example, to start required services in docker containers, run:

```
docker compose -f src/main/docker/<%= prodDatabaseType ?? databaseType %>.yml up -d
docker compose -f <%- dockerServicesDir %>services.yml up -d
```

To stop it and remove the container, run:
To stop it and remove the containers, run:

```
docker compose -f src/main/docker/<%= prodDatabaseType ?? databaseType %>.yml down
docker compose -f <%- dockerServicesDir %>services.yml down
```

[Spring Docker Compose Integration](https://docs.spring.io/spring-boot/reference/features/dev-services.html) is enable by default. Is possible to disable it in application.yml:

```yaml
spring:
...
docker:
compose:
enabled: false
```
<%_ } _%>

You can also fully dockerize your application and all the services that it depends on.
To achieve this, first build a docker image of your app by running:

```
```sh
npm run java:docker
```

Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running:

```
```sh
npm run java:docker:arm64
```

Then run:

```
```sh
docker compose -f <%- dockerServicesDir %>app.yml up -d
```

When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental `Use the new Virtualization framework` for better processing performance ([disk access performance is worse](https://github.com/docker/roadmap/issues/7)).

For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications.

## Continuous Integration (optional)
Expand Down
Loading