Skip to content

Commit

Permalink
✨ added setup for connecting application to spring database
Browse files Browse the repository at this point in the history
  • Loading branch information
jafacode committed Dec 30, 2024
1 parent f30c4c7 commit 3a2ba03
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,21 @@ services:
MYSQL_DATABASE: testdb
MYSQL_USER: user
MYSQL_PASSWORD: somepassword
networks:
- my-network

karrot:
image: narcoslocotaco/karrot_backend
depends_on:
- mysql
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/testdb
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: somepassword
ports:
- "8080:8080"
networks:
- my-network

networks:
my-network:
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://karrotdb.ctccq2e04brz.ap-northeast-2.rds.amazonaws.com:3306/karrotdb'
url: 'jdbc:mysql://localhost:3306/karrotdb'
driver-class-name: com.mysql.cj.jdbc.Driver
username: admin
password: somepassword
Expand Down

0 comments on commit 3a2ba03

Please sign in to comment.