Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jun-labs/springboot-docker-compose-support

๐Ÿƒ SpringBoot Docker Compose support.
https://github.com/jun-labs/springboot-docker-compose-support

docker docker-compose nosql rdbms springboot

Last synced: 8 days ago
JSON representation

๐Ÿƒ SpringBoot Docker Compose support.

Awesome Lists containing this project

README

        

# SpringBoot Docker-Compose





Docker Compose support in Spring Boot 3.1 builds
on top of the ConnectionDetails abstraction,
which weโ€™ve featured in a
separate blog post.

[![Release](https://img.shields.io/badge/-%F0%9F%93%9A%20Document-green)](https://spring.io/blog/2023/06/21/docker-compose-support-in-spring-boot-3-1)






## 1. Getting Started

ํ”„๋กœ์ ํŠธ ์‹คํ–‰ ์ „ .env์™€ .yml ํŒŒ์ผ์„ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.

> Java17 / Kotlin1.7 ๋ฒ„์ „ ์ด์ƒ์˜ JDK๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.




## Run Application

````text
$ ./gradlew bootRun
````




## Run Test

````text
$ ./gradlew test
````




## Run Build

````text
$ ./gradlew build
````







## 2. ๋„์ปค ์„ค์ •

.env ํŒŒ์ผ ์˜ˆ์‹œ.

```text
MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
MYSQL_DATABASE=DATABASE
MYSQL_USER=USER
MYSQL_PASSWORD=PASSWORD
TZ=Asia/Seoul
```





.env ํŒŒ์ผ์˜ MYSQL_DATABASE ๊ฐ’์€ .yml์˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์Šคํ‚ค๋งˆ์™€ ์ผ์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

```yaml
spring:

......

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver

# .env ํŒŒ์ผ์˜ MYSQL_DATABASE์™€ ์ผ์น˜
url: jdbc:mysql://localhost:3306/${MYSQL_DATABASE}
username: USER
password: PASSWORD
max-lifetime: 30000
hikari:
maximum-pool-size: 500
```