-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
.env
Outdated
@@ -0,0 +1,8 @@ | |||
MYSQLDB_DATABASE=book_store |
There was a problem hiding this comment.
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
docker-compose.yml
Outdated
"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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5005 to DEBUG_PORT
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
There was a problem hiding this comment.
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
There was a problem hiding this 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
MYSQLDB_ROOT_PASSWORD=pass | ||
MYSQLDB_LOCAL_PORT=port | ||
MYSQLDB_DOCKER_PORT=port | ||
|
||
SPRING_LOCAL_PORT=port | ||
SPRING_DOCKER_PORT=port | ||
DEBUG_PORT=port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MYSQLDB_DATABASE=db | |
MYSQLDB_DATABASE= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done
No description provided.