Containerized Java application deployed with MySQL and phpMyAdmin using Docker and Docker Compose. The project includes persistent database storage, environment-based configuration, container health checks, a private Nexus Docker registry, and remote deployment to DigitalOcean.
Java Application
|
v
MySQL Database
^
|
phpMyAdmin
The application stack runs as three Docker containers managed through Docker Compose:
- Java Application — Spring Boot application running on port
8080 - MySQL — application database running on port
3306 - phpMyAdmin — browser-based database management interface running on port
8081
- Docker
- Docker Compose
- Java / Spring Boot
- Gradle
- MySQL
- phpMyAdmin
- Sonatype Nexus Repository
- DigitalOcean
- Linux
- Git / GitHub
The Java application is built with Gradle into a deployable JAR:
gradle buildA Dockerfile packages the JAR with a Java runtime to create the application image:
docker build -t docker-exercises-app .Docker Compose manages the Java application, MySQL database, and phpMyAdmin containers as a single application stack.
The configuration includes:
- Container networking
- Environment-based database configuration
- Persistent MySQL storage using a Docker volume
- MySQL health checks
- Application dependency on a healthy database
- Port mappings for the application and database management interface
The stack can be started with:
docker compose up -dThe Java application image was published to a private Docker registry hosted with Sonatype Nexus Repository.
Deployment workflow:
Java Source Code
↓
Gradle Build
↓
JAR
↓
Docker Build
↓
Docker Image
↓
Nexus Registry
↓
Remote Server
↓
Docker Compose
This allows deployment servers to pull the packaged application image directly from the private registry instead of rebuilding the application on the server.
The application stack was deployed to a DigitalOcean Ubuntu server.
The deployment process included:
- Provisioning a Linux cloud server
- Installing Docker and Docker Compose
- Configuring access to the private Nexus Docker registry
- Authenticating the deployment server with Nexus
- Transferring the Docker Compose configuration to the server
- Pulling the application image from Nexus
- Starting the complete application stack with Docker Compose
- Verifying the application through the server's public endpoint
- Application containerization
- Docker image creation
- Multi-container orchestration with Docker Compose
- Container networking
- Persistent database storage
- Environment-based configuration
- Service health checks and dependencies
- Private artifact and image management with Nexus
- Cloud server provisioning
- Remote container deployment