Add Postgres Sql Docker Container myproject.database: image: postgres:latest container_name: myproject.database environment: - POSTGRES_DB=myproject - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres volumes: - ./.containers/myproject-db:/var/lib/postgresql/data ports: - 5432:5432 Add Redis Cach Docker Container myproject.cache: image: redis:latest restart: always ports: - 6379:6379 "Cache": "myproject.cache:6379" var sample = await cache.GetAsync($"samples-{id}", async token => { var sample = await context.Samples .AsNoTracking() .FirstOrDefaultAsync(p => p.Id == id, token); return sample; }, CacheOptions.DefaultExpiration);