# Setup Redis server on Docker 1. Start docker ``` $ docker-composer up -d ``` 2. to enter CLI ``` // check image name $ docker ps // enter interactive shell $ docker exec -it razer-redis_redis_1 redis-cli ``` 3. Test redis connectivity. [Reference](https://redis.io/topics/rediscli) ``` $ sudo apt install redis-tools // default : localhost:6379 $ redis-cli incr mycounter (integer) 1 // test ping using address $ redis-cli -h server1.razer.org -p 6379 -a ping PONG // or $ redis-cli -u redis://p%40ssw0rd@redis-16379.hosted.com:16379/0 ping $ redis-cli --stat $ redis-cli monitor // publish message to queue $ curl -u admin:admin -d "body=order_id" http://localhost:8161/api/message/shop?type=queue // publish message to topis $ curl -u admin:admin -d "body=order_id” http://localhost:8161/api/message/shop?type=topic ``` 4. Stop server ``` $ docker-compose down ```