Skip to content
Snippets Groups Projects
Commit ef493223 authored by schnarkus's avatar schnarkus
Browse files

use redis inside the dev container

parent 10db23c6
No related branches found
No related tags found
No related merge requests found
Pipeline #68967 passed
#!/bin/bash
REDIS_CONTAINER_NAME="redis_container"
REDIS_PORT="6379"
# Stop and remove old Redis container
podman stop $REDIS_CONTAINER_NAME
podman rm -f $REDIS_CONTAINER_NAME
# Pull Redis images
podman pull redis
podman pull redis-server
# Run Redis container with persistent storage
podman run -d \
-p $REDIS_PORT:$REDIS_PORT \
--name $REDIS_CONTAINER_NAME \
redis redis-server --save 60 1 --loglevel warning
echo "Redis setup complete..."
#curl -X PUT --header 'Content-Type: text/plain; charset=utf-8' --data 'foo' http://localhost:8080/state/bar
#podman exec -it redis_container redis-cli
#KEYS *
\ No newline at end of file
......@@ -46,4 +46,10 @@ podman exec -it $CONTAINER_NAME curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PO
echo "Testing from outside..."
sudo bash -c "echo '127.0.0.1 webservice.local' >> /etc/hosts"
curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/
\ No newline at end of file
curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/
echo "Testing Redis..."
curl -k -X PUT --header 'Content-Type: text/plain; charset=utf-8' --data 'foo' https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/state/bar
# Check the value in the database
podman exec -it $CONTAINER_NAME redis-cli KEYS '*'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment