Skip to content

Commit 7c4ac3c

Browse files
authored
Merge pull request #2 from elidaniel92/feature
Feature
2 parents 03e1554 + 49a0687 commit 7c4ac3c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This project serves as a boilerplate for building Java 17 applications using the
1616
- [**Java 17**](https://www.oracle.com/br/java/technologies/downloads/): The latest long-term support version of Java, ensuring modern language features and improvements.
1717
- [**Maven**](https://maven.apache.org/): Used for project management and dependency management.
1818
- [**Docker Compose**](https://docs.docker.com/compose/): Simplifies local development by allowing you to run the entire application stack (including MySQL) within Docker containers.
19-
- [**Dirk**](https://github.com/int4/dirk): A lightweight dependency injection library for managing object creation and dependencies.
19+
- [**Dirk**](https://github.com/hjohn/Dirk): A lightweight dependency injection library for managing object creation and dependencies.
2020
- [**SLF4J with Log4j2**](https://logging.apache.org/log4j/2.x/): Provides robust and flexible logging through the SLF4J API, using Log4j2 as the logging backend.
2121
- [**JDBC**](https://docs.oracle.com/javase/tutorial/jdbc/): Utilized for establishing a connection to relational databases and performing SQL operations.
2222
- [**MySQL Database**](https://www.mysql.com/): The database for storing and managing application data.

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
name: store-system
32
services:
43
# Java application

docker/Dockerfile.mysql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
FROM mysql:8
33

44
# Uncomment the environment variables if are running the "docker build" command
5-
ENV MYSQL_ROOT_PASSWORD=root
6-
ENV MYSQL_DATABASE=store
7-
ENV MYSQL_USER=admin
8-
ENV MYSQL_PASSWORD=admin
5+
# ENV MYSQL_ROOT_PASSWORD=root
6+
# ENV MYSQL_DATABASE=store
7+
# ENV MYSQL_USER=admin
8+
# ENV MYSQL_PASSWORD=admin
99

1010
# Copy the database initialization script to the container
1111
COPY docker/init.sql /docker-entrypoint-initdb.d/

src/main/java/com/elidaniel92/app/Bootstrap.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ public Bootstrap(DatabaseConnection databaseConnection, Scheduler scheduler) {
2626
public void initialize() {
2727
log.info("Initializing all services...");
2828
try {
29-
databaseConnection.connect();
30-
scheduler.start();
29+
databaseConnection.connect();
3130
} catch (SQLException e) {
3231
log.error("Database connection failed, finishing application", e);
32+
return;
3333
}
34+
scheduler.start();
3435
}
3536
}

0 commit comments

Comments
 (0)