diff --git a/.github/workflows/aws-cicd-dev.yml b/.github/workflows/aws-cicd-dev.yml index 37627514..af5968da 100644 --- a/.github/workflows/aws-cicd-dev.yml +++ b/.github/workflows/aws-cicd-dev.yml @@ -4,7 +4,7 @@ on: push: branches: - develop - - feat/LA-20_3 + - feat/LA-27-2 env: REGISTRY: "docker.io" diff --git a/.github/workflows/aws-cicd-prod.yml b/.github/workflows/aws-cicd-prod.yml index 33aa5669..110d2a80 100644 --- a/.github/workflows/aws-cicd-prod.yml +++ b/.github/workflows/aws-cicd-prod.yml @@ -4,6 +4,7 @@ on: push: branches: - main +# - feat/LA-27-2 env: REGISTRY: "docker.io" diff --git a/layer-api/infra/development/Dockerfile-redis b/layer-api/infra/development/Dockerfile-redis new file mode 100644 index 00000000..f1ba86b8 --- /dev/null +++ b/layer-api/infra/development/Dockerfile-redis @@ -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"] \ No newline at end of file diff --git a/layer-api/infra/development/docker-compose.yaml b/layer-api/infra/development/docker-compose.yaml index b0ea5bbe..3fa0d5e2 100644 --- a/layer-api/infra/development/docker-compose.yaml +++ b/layer-api/infra/development/docker-compose.yaml @@ -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 diff --git a/layer-api/infra/production/Dockerfile-redis b/layer-api/infra/production/Dockerfile-redis new file mode 100644 index 00000000..f1ba86b8 --- /dev/null +++ b/layer-api/infra/production/Dockerfile-redis @@ -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"] \ No newline at end of file diff --git a/layer-api/infra/production/docker-compose-blue.yaml b/layer-api/infra/production/docker-compose-blue.yaml index 1f7311d0..53b15b2a 100644 --- a/layer-api/infra/production/docker-compose-blue.yaml +++ b/layer-api/infra/production/docker-compose-blue.yaml @@ -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 @@ -48,4 +58,7 @@ services: restart: always networks: - app-network: \ No newline at end of file + app-network: + +volumes: + redis-data: \ No newline at end of file diff --git a/layer-api/infra/production/docker-compose-green.yaml b/layer-api/infra/production/docker-compose-green.yaml index 9df97019..bf0170a5 100644 --- a/layer-api/infra/production/docker-compose-green.yaml +++ b/layer-api/infra/production/docker-compose-green.yaml @@ -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 diff --git a/layer-api/infra/production/redis.conf b/layer-api/infra/production/redis.conf new file mode 100644 index 00000000..21c696c5 --- /dev/null +++ b/layer-api/infra/production/redis.conf @@ -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