This is a test project for Redis, in .net 10 and C#. It includes a Docker Compose file to set up a Redis instance with a specified password and data persistence.
Yes, there is a password in the files. No, it is not a password I use outside of this test project.
The docker-compose.yaml file sets up a Redis instance with the following configuration:
- Image:
redis:latest - Container name:
redis-test - Ports:
6379:6379 - Command:
redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81 - Volumes:
.\redis-data:/data(for data persistence)
The .gitignore file includes the following entries:
redis-data/(to ignore the Redis data directory)
To run the Redis instance, use the following command in the terminal:
docker-compose up -dThis will start the Redis container in detached mode. You can then connect to it using the specified password.
To stop the Redis instance, use:
docker-compose downMake sure to replace the password in the command with your own secure password if you plan to use this setup for anything beyond testing.
I trust you know how to run a .NET application, but if you need a reminder, you can use the following command in the terminal:
dotnet run --project .\PaddySe.RedisTest.Web\PaddySe.RedisTest.Web.csprojYou can then navigate to http://localhost:5000 in your web browser to see the application in action. The application will connect to the Redis instance and perform some basic operations to demonstrate its functionality.