Added dockerfile and docker-compose#6
Open
LujainaALMuharrami wants to merge 1 commit intoCodelineAtyab:mainfrom
Open
Added dockerfile and docker-compose#6LujainaALMuharrami wants to merge 1 commit intoCodelineAtyab:mainfrom
LujainaALMuharrami wants to merge 1 commit intoCodelineAtyab:mainfrom
Conversation
CodelineAtyab
requested changes
Aug 8, 2024
Owner
CodelineAtyab
left a comment
There was a problem hiding this comment.
Please respond to comments
| COPY --from=build /app/target/rihal-0.0.1-SNAPSHOT.jar /app/rihal-0.0.1-SNAPSHOT.jar | ||
| EXPOSE 8080 | ||
|
|
||
| ENTRYPOINT ["sh", "-c", "java -jar rihal-0.0.1-SNAPSHOT.jar"] No newline at end of file |
Owner
There was a problem hiding this comment.
Is there any benefit of running java through "sh" and not directly using ENTRYPOINT ["java", "-jar", "/app/your-application.jar"] ?
| WORKDIR /app | ||
| COPY pom.xml /app/ | ||
| COPY src /app/src/ | ||
| Run mvn clean package -DskipTests |
Owner
There was a problem hiding this comment.
I think this should be RUN to make the case consistent with other keywords
Owner
There was a problem hiding this comment.
Target directory is meant for the machine the build is generated on. It should not be pushed to GitHub
| environment: | ||
| SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3307/usersystem?useSSL=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true | ||
| SPRING_DATASOURCE_USERNAME: root | ||
| SPRING_DATASOURCE_PASSWORD: root |
Owner
There was a problem hiding this comment.
We should never push the password on GitHub.
Using the .env file can help solve this issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I’ve set up the app and database using Dockerfile and Docker Compose, and I use DbVisualizer to manage the MySQL database.
:))