Skip to content

Commit

Permalink
chore: dev, prod에 redis 컨테이너 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
clean2001 committed Dec 11, 2024
1 parent 349c39c commit 4826b29
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws-cicd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- develop
- feat/LA-20_3
- feat/LA-27-2

env:
REGISTRY: "docker.io"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/aws-cicd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
# - feat/LA-27-2

env:
REGISTRY: "docker.io"
Expand Down
8 changes: 8 additions & 0 deletions layer-api/infra/development/Dockerfile-redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Base image
FROM redis:latest

# Copy custom Redis configuration
COPY redis.conf /usr/local/etc/redis/redis.conf

# Command to run Redis with the custom configuration
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
10 changes: 10 additions & 0 deletions layer-api/infra/development/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
services:
redis:
build:
context: .
dockerfile: Dockerfile-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data # Persistent data storage
restart: always

java-app:
image: docker.io/clean01/layer-server_layer-api:latest
container_name: layer-api
Expand Down
8 changes: 8 additions & 0 deletions layer-api/infra/production/Dockerfile-redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Base image
FROM redis:latest

# Copy custom Redis configuration
COPY redis.conf /usr/local/etc/redis/redis.conf

# Command to run Redis with the custom configuration
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
15 changes: 14 additions & 1 deletion layer-api/infra/production/docker-compose-blue.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
services:
redis:
build:
context: .
dockerfile: Dockerfile-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data # Persistent data storage
restart: always

layer-api-blue:
image: docker.io/clean01/layer-server_layer-api:latest
container_name: layer-api-blue
Expand Down Expand Up @@ -48,4 +58,7 @@ services:
restart: always

networks:
app-network:
app-network:

volumes:
redis-data:
9 changes: 9 additions & 0 deletions layer-api/infra/production/docker-compose-green.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
services:
redis:
build:
context: .
dockerfile: Dockerfile-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data # Persistent data storage
restart: always
layer-api-green:
image: docker.io/clean01/layer-server_layer-api:latest
container_name: layer-api-green
Expand Down
20 changes: 20 additions & 0 deletions layer-api/infra/production/redis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Save the DB snapshot every 180 seconds if at least 1 key changes
save 180 1

# Specify the filename for the RDB file
dbfilename dump.rdb

# Directory where the RDB snapshot will be saved
dir /data

# Enable RDB snapshot logging (optional for debugging)
loglevel notice

# Disable AOF (if you want only RDB persistence)
appendonly no

# Compression for RDB files (enabled by default)
rdbcompression yes

# Checksum verification for RDB files (enabled by default)
rdbchecksum yes

0 comments on commit 4826b29

Please sign in to comment.