-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42f1a5c
commit 95e3b9d
Showing
3 changed files
with
71 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM openjdk:8-jre-alpine | ||
LABEL description="java-mysql-example-app" | ||
LABEL version="1.0" | ||
LABEL maintainer="Hatem AlSum ([email protected])" | ||
|
||
ADD target/java-mysql-example-app-1.0-SNAPSHOT-jar-with-dependencies.jar app.jar | ||
|
||
CMD echo "The application will start now..." && \ | ||
sleep 60s && \ | ||
java -jar app.jar |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '2' | ||
services: | ||
java-app: | ||
image: jexampleapp | ||
environment: | ||
- PORT=8080 | ||
- MYSQLS_HOSTNAME=app-mysql | ||
- MYSQLS_PORT=3306 | ||
- MYSQLS_USERNAME=root | ||
- MYSQLS_PASSWORD=my-secret-pw | ||
- MYSQLS_DATABASE=mysql | ||
ports: | ||
- 8080:8080 | ||
depends_on: | ||
- app-mysql | ||
app-mysql : | ||
image: mysql:5.7 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=my-secret-pw | ||
ports: | ||
- 3306:3306 |
This file contains 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