Skip to content

Commit 8a1b073

Browse files
author
Simon Prickett
authored
Merge pull request #47 from redislabs-training/move-docker-to-redis-stack
Work in progress to swap to Redis Stack.
2 parents 8123342 + f8e1c35 commit 8a1b073

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ Solutions to the course programming challenges can be found on the `solutions` b
1313
In order to start and run this application, you will need:
1414

1515
- [Node.js](https://nodejs.org/en/download/) (8.9.4 or newer, we recommend using the current Long Term Stable version)
16-
- npm (installed with Node.js)
17-
- Access to a local or remote installation of [Redis](https://redis.io/download) version 5 or newer (local preferred)
18-
- If you want to try the RedisTimeSeries exercises, you'll need to make sure that your Redis installation also has the [RedisTimeSeries Module](https://oss.redis.com/redistimeseries/) installed
16+
- npm (installed with Node.js).
17+
- Access to a local or remote installation of [Redis Stack](https://redis.io/docs/stack/get-started/install/) - local preferred, we provide a Docker Compose file in this repo, read on for details.
1918

2019
If you're using Windows, check out the following resources for help with running Redis:
2120

@@ -24,26 +23,39 @@ If you're using Windows, check out the following resources for help with running
2423

2524
# Setup
2625

27-
To get started:
26+
To get started, clone this repository:
27+
28+
```
29+
$ git clone https://github.com/redislabs-training/ru102js.git
30+
$ cd ru102js
31+
```
32+
33+
Now install the dependencies:
2834

2935
```
3036
$ npm install
3137
```
32-
You'll also need to have the RedisTimeSeries module installed, which you can get by going through the following steps:
38+
39+
You'll also need to have a Redis Stack instance running. Either [install it locally](https://redis.io/docs/stack/get-started/install/), or use the Docker Compose file provided:
40+
3341
- Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
34-
- Check your Docker Compose version using ```docker-compose --version```. In order for our compose file to work, you need to have at least v1.27.0.
3542
- Start up the Docker daemon.
36-
- Run ```docker-compose up -d``` in the project directory. This command will give you Redis on localhost port 6379 with no password required, with the required RedisTimeSeries module installed. The container will persist Redis data to the ```redisdata``` folder.
43+
- Run ```docker-compose up -d``` in the project directory. This command will give you Redis Stack on localhost port 6379 with no password required. The container will persist Redis data to the ```redisdata``` folder.
3744

3845
You should see the following once the command has successfully run:
3946

40-
<img src=docker-compose.png width="450" height="200">
47+
```
48+
Creating network "ru102js_default" with the default driver
49+
Creating redis_ru102js ... done
50+
```
4151

42-
You'll also see the ```ru102js``` container running if you open up the Docker app.
52+
You'll also see the ```redis_ru102js``` container running if you open up the Docker app.
4353

44-
If you get an error that says something like ```Version in "./docker-compose.yml" is unsupported```, you probably need to update your docker compose version to 1.27.0 or higher.
54+
If you want to shut down the Redis Stack container, use:
4555

46-
If you want to shut down the Redis container, you can run ```docker-compose down```.
56+
```
57+
docker-compose down
58+
```
4759

4860
# Configuration
4961

@@ -134,6 +146,14 @@ subsets of tests and many more options:
134146
npm testdev
135147
```
136148

149+
# Optional (but Recommended): RedisInsight
150+
151+
RedisInsight is a graphical tool for viewing data in Redis and managing Redis server instances. You don't need to install it to be successful with this course, but we recommend it as a good way of viewing data stored in Redis.
152+
153+
To use RedisInsight, you'll need to [download it](https://redis.io/docs/ui/insight/) then point it at your Redis instance.
154+
155+
If you're using the Docker Compose file provided with this course to run Redis Stack, you can optionally choose to access a web-based version of Redis Stack at `http://localhost:8001` whenever the container is running.
156+
137157
# Linting
138158

139159
This project uses [ESLint](https://eslint.org/) with a slightly modified version of the

docker-compose.png

-272 KB
Binary file not shown.

docker-compose.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
version: "3.9"
22
services:
33
redis:
4-
container_name: redistimeseries_ru102js
5-
image: redislabs/redistimeseries:latest
6-
expose:
7-
- "6379"
4+
container_name: redis_ru102js
5+
image: redis/redis-stack:latest
86
ports:
97
- "6379:6379"
8+
- "8001:8001"
109
volumes:
1110
- ./redisdata:/data
12-
security_opt:
13-
- "no-new-privileges:true"
11+
deploy:
12+
replicas: 1
13+
restart_policy:
14+
condition: on-failure

0 commit comments

Comments
 (0)