Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .env
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For review purposes it's fine, but we should never push the changes with a .env file. The reason is that, this .env is environment specific. On our PC there might be a MySQL server running locally with a different username and password.
Similarly, Another team member may spin up a container and point to a MySQL server running on cloud.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=usersystem
MYSQL_USER=root
MYSQL_PASSWORD=root
SPRING_DATASOURCE_URL=jdbc:mysql://mysql-cont:3306/usersystem?useSSL=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME=root
SPRING_DATASOURCE_PASSWORD=root
SPRING_JPA_HIBERNATE_DDL_AUTO=update
SPRING_JPA_SHOW_SQL=true
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3.8'

services:
database:
image: mysql:8.0.32
container_name: userinfostoreapp-mysql
ports:
- "3308:3306"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql

application:
build: .
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no Dockerfile in the current directory. Please push the Dockerfile

container_name: userinfostoreapp-app
ports:
- "8081:8080"
env_file:
- .env
depends_on:
- database
volumes:
- ./logs:/app/logs

volumes:
mysql_data: