Skip to content

Added dockerfile and docker-compose#5

Open
marwan95 wants to merge 1 commit intoCodelineAtyab:mainfrom
marwan95:main
Open

Added dockerfile and docker-compose#5
marwan95 wants to merge 1 commit intoCodelineAtyab:mainfrom
marwan95:main

Conversation

@marwan95
Copy link

Added dockerfile and docker-compose


EXPOSE 8080

ENV SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3307/usersystem?useSSL=false&serverTimezone=UTC&createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true
Copy link
Owner

Choose a reason for hiding this comment

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

If we change the values directly in the Dockerfile, then we would need to rebuild the Docker image to apply these changes. This is because the environment variables are baked into the image during the build process.

environment:
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
Copy link
Owner

Choose a reason for hiding this comment

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

We should never push the password on GitHub.
Using the .env file can help solve this issues.

Copy link
Owner

@CodelineAtyab CodelineAtyab left a comment

Choose a reason for hiding this comment

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

Please respond to a comment

container_name: java-app
ports:
- "8080:8080"
environment:
Copy link
Owner

Choose a reason for hiding this comment

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

Will these values override the values defined in the Dockerfile ?

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.

2 participants