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

docker #16

Merged
merged 7 commits into from
Oct 3, 2024
Merged

docker #16

merged 7 commits into from
Oct 3, 2024

Conversation

ChabVlad
Copy link
Owner

@ChabVlad ChabVlad commented Oct 1, 2024

No description provided.

.env Outdated
@@ -0,0 +1,8 @@
MYSQLDB_DATABASE=book_store
Copy link

Choose a reason for hiding this comment

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

git rm --cached .env - .env should never be in version control, add .env.template instead with actual values removed - otherwise we would need to search for all env var throughout the project to start it

"spring.datasource.password" : "$MYSQLDB_ROOT_PASSWORD",
"spring.jpa.properties.hibernate.dialect" : "org.hibernate.dialect.MySQLDialect"
}'
JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
Copy link

Choose a reason for hiding this comment

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

5005 to DEBUG_PORT

@ChabVlad ChabVlad requested a review from okuzan October 2, 2024 12:25
@@ -1,8 +1,6 @@
spring.application.name=BookStore
spring.datasource.url=jdbc:mysql://localhost/book_store?serverTimezone=UTC
spring.datasource.url=jdbc:mysql://mysqldb:3306/book_store?serverTimezone=UTC

Choose a reason for hiding this comment

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

Why did you change it?

Copy link

@Elena-Bruyako Elena-Bruyako left a comment

Choose a reason for hiding this comment

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

see comment

@@ -1,8 +1,6 @@
spring.application.name=BookStore
spring.datasource.url=jdbc:mysql://localhost/book_store?serverTimezone=UTC

Choose a reason for hiding this comment

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

Suggested change
spring.datasource.url=jdbc:mysql://localhost/book_store?serverTimezone=UTC
spring.datasource.url=jdbc:mysql://localhost:3306/book_store?serverTimezone=UTC

Also, you can get properties from .env file spring.config.import=optional:file:.env[.properties]
In this case you will have like:
spring.datasource.username=${MYSQLDB_USER} etc

.env.template Outdated
@@ -0,0 +1,9 @@
MYSQLDB_USER=${MYSQLDB_USER}
Copy link

Choose a reason for hiding this comment

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

this doesn't make much sense. It's kinda a recursion :) Better remove everything after = altogether

Copy link

@Elena-Bruyako Elena-Bruyako left a comment

Choose a reason for hiding this comment

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

see comment

.env.template Outdated
Comment on lines 3 to 9
MYSQLDB_ROOT_PASSWORD=pass
MYSQLDB_LOCAL_PORT=port
MYSQLDB_DOCKER_PORT=port

SPRING_LOCAL_PORT=port
SPRING_DOCKER_PORT=port
DEBUG_PORT=port

Choose a reason for hiding this comment

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

Suggested change
MYSQLDB_ROOT_PASSWORD=pass
MYSQLDB_LOCAL_PORT=port
MYSQLDB_DOCKER_PORT=port
SPRING_LOCAL_PORT=port
SPRING_DOCKER_PORT=port
DEBUG_PORT=port
MYSQLDB_ROOT_PASSWORD=
MYSQLDB_LOCAL_PORT=
MYSQLDB_DOCKER_PORT=
SPRING_LOCAL_PORT=
SPRING_DOCKER_PORT=
DEBUG_PORT=

.env.template Outdated
@@ -0,0 +1,9 @@
MYSQLDB_USER=user
MYSQLDB_DATABASE=db

Choose a reason for hiding this comment

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

Suggested change
MYSQLDB_DATABASE=db
MYSQLDB_DATABASE=

Copy link

@Elena-Bruyako Elena-Bruyako left a comment

Choose a reason for hiding this comment

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

well done

@ChabVlad ChabVlad merged commit 8f63470 into main Oct 3, 2024
2 checks passed
@ChabVlad ChabVlad deleted the docker branch October 3, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants