forked from freeleaps/freeleaps-pub
Add redis to devbox
This commit is contained in:
parent
c76f74a82a
commit
3a3ba9d002
@ -935,7 +935,7 @@ if [[ $USE_LOCAL_COMPONENT_VAL == true ]]; then
|
||||
|
||||
# Start Gitea, MongoDB, RabbitMQ and other components containers
|
||||
echo "===> start Gitea, MongoDB, RabbitMQ and other components containers"
|
||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq gitea "${start_components[@]}"
|
||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq gitea redis "${start_components[@]}"
|
||||
|
||||
gitea_container_id=$(docker ps --no-trunc -a --filter "name=^freeleaps2-gitea$" --format "{{.ID}}")
|
||||
echo "$gitea_container_id" > "$WORKING_HOME/.gitea-instance"
|
||||
@ -946,6 +946,9 @@ if [[ $USE_LOCAL_COMPONENT_VAL == true ]]; then
|
||||
rabbitmq_container_id=$(docker ps --no-trunc -a --filter "name=^freeleaps2-rabbitmq$" --format "{{.ID}}")
|
||||
echo "$rabbitmq_container_id" > "$WORKING_HOME/.rabbitmq-instance"
|
||||
|
||||
redis_container_id=$(docker ps --no-trunc -a --filter "name=^freeleaps2-redis$" --format "{{.ID}}")
|
||||
echo "$redis_container_id" > "$WORKING_HOME/.redis-instance"
|
||||
|
||||
|
||||
# Get all components container ids and save to .component-instance file
|
||||
for component in "${start_components[@]}"; do
|
||||
@ -967,7 +970,7 @@ else
|
||||
echo ' ===> Using online components for Freeleaps services.'
|
||||
echo '============================================'
|
||||
# Start Gitea, MongoDB, RabbitMQ containers
|
||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq
|
||||
docker-compose -f docker-compose.dev.arm64.new.yaml up -d mongodb rabbitmq redis
|
||||
echo "===> start components is $start_components"
|
||||
|
||||
# Save MongoDB and RabbitMQ container ids to .mongodb-instance and .rabbitmq-instance
|
||||
@ -976,6 +979,9 @@ else
|
||||
|
||||
rabbitmq_container_id=$(docker ps -a --format '{{.Names}}' | grep "^freeleaps2-rabbitmq\$")
|
||||
echo "$rabbitmq_container_id" > "$WORKING_HOME/.rabbitmq-instance"
|
||||
|
||||
redis_container_id=$(docker ps -a --format '{{.Names}}' | grep "^freeleaps2-redis\$")
|
||||
echo "$redis_container_id" > "$WORKING_HOME/.redis-instance"
|
||||
fi
|
||||
|
||||
# Check all components are started
|
||||
|
||||
@ -61,6 +61,24 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
platform: linux/${ARCH:-arm64}
|
||||
container_name: freeleaps2-redis
|
||||
image: rabbitmq:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 6379:6379
|
||||
networks:
|
||||
- devbox_freeleaps2-network
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
volumes:
|
||||
- ${WORKING_HOME}/freeleaps2-redis-data:/var/lib/redis
|
||||
|
||||
devsvc:
|
||||
container_name: devsvc
|
||||
image: freeleaps/devsvc:${DEVSVC_IMAGE_TAG:-latest-linux-arm64}
|
||||
@ -277,6 +295,8 @@ services:
|
||||
condition: service_healthy
|
||||
rabbitmq:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 8012:8012
|
||||
environment:
|
||||
@ -301,6 +321,7 @@ services:
|
||||
- FREELEAPS_NOTIFICATION_ENDPOINT=http://notification:8003/api/notification/
|
||||
- FREELEAPS_CENTRAL_STORAGE_ENDPOINT=http://central_storage:8005/api/central_storage/
|
||||
- FREELEAPS_AUTHENTICATION_ENDPOINT=http://authentication:8004/api/auth/
|
||||
- REDIS_URL=redis://freeleaps2-redis:6379/0
|
||||
- TZ=Asia/Shanghai
|
||||
command:
|
||||
# Use a conditional check for RabbitMQ in alpha profile
|
||||
|
||||
Loading…
Reference in New Issue
Block a user