Skip to content

Containerized App and DB#9

Open
ArwaAlkindi wants to merge 1 commit intoCodelineAtyab:mainfrom
ArwaAlkindi:arwa-alkindi-containerize-app
Open

Containerized App and DB#9
ArwaAlkindi wants to merge 1 commit intoCodelineAtyab:mainfrom
ArwaAlkindi:arwa-alkindi-containerize-app

Conversation

@ArwaAlkindi
Copy link

To build the image, a Dockerfile was created with maven:3.8.1-openjdk-17 as a base image. A docker compose file was created with two services(containers): mysql, which runs a mysql instance, and userapp, which is built using the Dockerfile and runs the Java application. The environment variables for both containers are stored in '.env' and referenced in the docker compose. Both containers are configured to be part of the same internal network to ensure successful communication between the applications.

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.

@@ -0,0 +1,19 @@
FROM maven:3.8.1-openjdk-17 AS build
Copy link
Owner

Choose a reason for hiding this comment

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

Is this "build" alias supposed to be used anywhere ?

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