Skip to content

Commit

Permalink
feat: Springboot Application + MySQL + Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
lomayd committed Oct 28, 2022
1 parent 07e9cb7 commit 874e891
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
version: '3.1'
services:
mysql:
container_name: mysql_database
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: ssd
MYSQL_ROOT_PASSWORD: ssd
MYSQL_USER: ssd
MYSQL_PASSWORD: ssd
MYSQL_DATABASE: ssd_database
MYSQL_ROOT_PASSWORD:

springboot:
container_name: springboot_application
build:
context: ./
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql_database:3306/ssd_database
SPRING_DATASOURCE_USERNAME: "root"
SPRING_DATASOURCE_PASSWORD:
depends_on:
- mysql
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/ssd
url: jdbc:mysql://127.0.0.1:3306/ssd_database
username: root
password:
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
//@SpringBootTest
class SsdBackendApplicationTests {

@Test
Expand Down

0 comments on commit 874e891

Please sign in to comment.