Skip to content

Commit 31dd1a0

Browse files
committed
add docker image of redis and also add spirng boot redis dependency
1 parent b4ef597 commit 31dd1a0

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

docker-compose.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
SPRING_DATASOURCE_PASSWORD: password
1313
depends_on:
1414
- db
15+
- cache
1516
db:
1617
image: postgres:latest
1718
environment:
@@ -23,8 +24,19 @@ services:
2324
- "5433:5433"
2425
volumes:
2526
- db_data:/var/lib/postgresql/data
26-
# I use this command to force the image to use port 5433
27-
command: ["postgres", "-p", "5433"]
27+
# I use this command to force the image to use port 5433
28+
command: [ "postgres", "-p", "5433" ]
29+
30+
cache:
31+
image: redis:6.2-alpine
32+
restart: always
33+
ports:
34+
- "6379:6379"
35+
command: redis-server --save 20 1 --loglevel warning
36+
volumes:
37+
- cache:/data
2838

2939
volumes:
30-
db_data:
40+
db_data:
41+
cache:
42+
driver: local

pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
9696
<version>2.6.0</version>
9797
</dependency>
98+
99+
<dependency>
100+
<groupId>org.springframework.boot</groupId>
101+
<artifactId>spring-boot-starter-data-redis</artifactId>
102+
<version>3.3.5</version>
103+
</dependency>
104+
98105
</dependencies>
99106

100107
<build>
@@ -127,7 +134,8 @@
127134
<version>0.8.11</version>
128135
<configuration>
129136
<excludes>
130-
<exclude>com/wora/state_of_dev/survey/application/mapper/**</exclude> <!-- Exclude MapStruct package -->
137+
<exclude>com/wora/state_of_dev/survey/application/mapper/**
138+
</exclude> <!-- Exclude MapStruct package -->
131139
</excludes>
132140
</configuration>
133141
<executions>

0 commit comments

Comments
 (0)