-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cache): implement caching system using Redis for company and emp…
…loyee services - added Redis cache configuration in `application-dev.yml`, `application-prod.yml`, and `application-test.yml` - enabled caching in the Spring Boot application with `@EnableCaching` - introduced `spring-boot-starter-data-redis` dependency in `pom.xml` for Redis integration - implemented caching for `CompanyService` and `EmployeeService` using `@Cacheable`, `@CacheEvict` - cache added for fetching companies and employees, with methods caching paginated results and searching by name - adjusted Docker Compose files to include Redis service for local and production environments Closes #10
- Loading branch information
Showing
13 changed files
with
280 additions
and
61 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 |
---|---|---|
@@ -1,37 +1,34 @@ | ||
# Multi-stage Dockerfile: Build and run a Java application | ||
# Docker image build for GZGest o | ||
# | ||
# This Dockerfile creates the GZGest o image using the following steps: | ||
# | ||
# 1. Maven 3.9.8-eclipse-temurin-21-jammy base image | ||
# 2. Copy pom.xml and install dependencies using offline mode | ||
# 3. Copy source code and build the application | ||
# 4. Copy the JAR file to the /app directory | ||
# 5. Create a user and change to that user | ||
# 6. Start the application with the JAR file | ||
|
||
# Stage 1: Use Maven to build the application, skipping tests. | ||
FROM maven:3.9.8-eclipse-temurin-21-jammy AS build | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the POM file first | ||
COPY pom.xml ./ | ||
|
||
# Cache Maven dependencies | ||
RUN mvn dependency:go-offline -B | ||
|
||
# Copy the source code only if dependencies are resolved | ||
COPY src ./src | ||
|
||
# Build the application, skipping tests | ||
RUN mvn package -DskipTests -B | ||
|
||
# Stage 2: Run the application using a non-root user | ||
FROM eclipse-temurin:21-jre-jammy | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the JAR file from the build stage | ||
COPY --from=build /app/target/*.jar app.jar | ||
|
||
# Create a non-root user | ||
RUN useradd -m myuser | ||
|
||
# Set the user | ||
USER myuser | ||
|
||
# Set the entrypoint | ||
ENTRYPOINT ["java", "-jar", "app.jar"] | ||
ENTRYPOINT ["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
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
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
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
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
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
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
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
Oops, something went wrong.