Skip to content

Commit 84d5000

Browse files
committed
chore: add docker compose to make contributor easy
1 parent be0b2e6 commit 84d5000

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,26 @@ module.exports = app => {
233233
};
234234
```
235235

236+
## For the local dev
237+
238+
Run docker compose to start test redis service
239+
240+
```bash
241+
docker compose -f docker-compose.yml up -d
242+
```
243+
244+
Run the unit tests
245+
246+
```bash
247+
npm test
248+
```
249+
250+
Stop test redis service
251+
252+
```bash
253+
docker compose -f docker-compose.yml down
254+
```
255+
236256
## Questions & Suggestions
237257

238258
Please open an issue [here](https://github.com/eggjs/egg/issues).

docker-compose.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: eggjs_redis_dev
2+
3+
services:
4+
redis:
5+
image: redis:alpine
6+
ports:
7+
- 6379:6379

test/fixtures/apps/ts-multi/redisapp-ts/app/controller/home.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ declare module 'egg' {
1414
export default class HomeController extends Controller {
1515
async index() {
1616
const { ctx,app } = this;
17+
// @deprecated please use `getSingletonInstance(id)` instead
1718
const redis = app.redis.get('cache') as unknown as Redis;
1819
await redis.set('foo', 'bar');
1920
const redis2 = app.redis.getSingletonInstance('cache');

0 commit comments

Comments
 (0)