Skip to content

Commit be5577c

Browse files
RI-5042: Add documentation for env variables
1 parent 4899dcf commit be5577c

File tree

6 files changed

+34
-10
lines changed

6 files changed

+34
-10
lines changed

DOCKER_README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Docker
2+
3+
Included in this repository is a Dockerfile that can be used to deploy a hosted instance of Redis Insight.
4+
5+
# Usage
6+
7+
To build and run the image locally with Docker buildx, simply
8+
9+
```
10+
$ docker buildx build -t redis-insight:latest
11+
$ docker run -d -p5000:5000 redis-insight:latest
12+
```
13+
14+
These commands will build the image and then start the container. Redis Insight can then be accessed on localhost port 5000, `http://localhost:5000`.
15+
16+
# Configuration
17+
18+
Redis Insight supports several configuration values that can be supplied via container environment variables. The following may be provided:
19+
20+
| Variable | Purpose | Default | Additional Info |
21+
| ---------|---------|-----------------|---------|
22+
| RI_APP_PORT | The port the app listens on | 5000 | See [Express Documentation](https://expressjs.com/en/api.html#app.listen) |
23+
| RI_APP_HOST | The host the app listens on | 0.0.0.0 | See [Express Documentation](https://expressjs.com/en/api.html#app.listen) |
24+
| RI_SERVER_TLS | Enable HTTPS | false | If `true`, requires RI_SERVER_TLS_KEY and RI_SERVER_TLS_CERT as well. |
25+
| RI_SERVER_TLS_KEY | Private key for HTTPS | | Private key in [PEM format](https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3). May be a path to a file or a string in PEM format. |
26+
| RI_SERVER_TLS_CERT | Certificate for supplied private key | | Public certificate in [PEM format](https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3) |

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ FROM node:18.18-alpine
4343

4444
# runtime args and environment variables
4545
ARG NODE_ENV=production
46-
ARG RI_HOSTNAME
46+
ARG RI_APP_HOST
4747
ARG RI_APP_PORT=5000
4848
ARG RI_SERVER_TLS
4949
ARG RI_SERVER_TLS_CERT
5050
ARG RI_SERVER_TLS_KEY
5151
ARG SEGMENT_WRITE_KEY
52-
ENV RI_HOSTNAME=${RI_HOSTNAME}
52+
ENV RI_APP_HOST=${RI_APP_HOST}
5353
ENV RI_APP_PORT=${RI_APP_PORT}
5454
ENV RI_SERVER_TLS=${RI_SERVER_TLS}
5555
ENV RI_SERVER_TLS_CERT=${RI_SERVER_TLS_CERT}

configs/webpack.config.main.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default merge(baseConfig, {
6262
RI_SERVER_TLS_KEY: process.env.RI_SERVER_TLS_KEY || '',
6363
APP_FOLDER_NAME: process.env.APP_FOLDER_NAME || '',
6464
UPGRADES_LINK: process.env.UPGRADES_LINK || '',
65-
RI_HOSTNAME: '127.0.0.1',
65+
RI_APP_HOST: '127.0.0.1',
6666
BUILD_TYPE: 'ELECTRON',
6767
APP_VERSION: version,
6868
AWS_BUCKET_NAME:

configs/webpack.config.main.stage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default merge(mainProdConfig, {
2626
RI_SERVER_TLS_KEY: process.env.RI_SERVER_TLS_KEY || '',
2727
APP_FOLDER_NAME: process.env.APP_FOLDER_NAME || '',
2828
UPGRADES_LINK: process.env.UPGRADES_LINK || '',
29-
RI_HOSTNAME: '127.0.0.1',
29+
RI_APP_HOST: '127.0.0.1',
3030
BUILD_TYPE: 'ELECTRON',
3131
APP_VERSION: version,
3232
AWS_BUCKET_NAME:

redisinsight/api/config/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
server: {
4444
version,
4545
env: 'development',
46-
listenInterface: process.env.RI_HOSTNAME ?? '0.0.0.0',
46+
host: process.env.RI_APP_HOST ?? '0.0.0.0',
4747
port: process.env.RI_APP_PORT ?? 5000,
4848
docPrefix: 'api/docs',
4949
globalPrefix: 'api',

redisinsight/api/src/main.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface IApp {
2626
export default async function bootstrap(): Promise<IApp> {
2727
await migrateHomeFolder();
2828

29-
const port = serverConfig.port;
29+
const { port, host } = serverConfig;
3030
const logger = WinstonModule.createLogger(LOGGER_CONFIG);
3131

3232
const options: NestApplicationOptions = {
@@ -66,11 +66,9 @@ export default async function bootstrap(): Promise<IApp> {
6666

6767
const logFileProvider = app.get(LogFileProvider);
6868

69-
await app.listen(port, serverConfig.listenInterface);
69+
await app.listen(port, host);
7070
logger.log({
71-
message: `Server is running on http(s)://${
72-
serverConfig.listenInterface ?? 'localhost'
73-
}:${port}`,
71+
message: `Server is running on http(s)://${host}:${port}`,
7472
context: 'bootstrap',
7573
});
7674

0 commit comments

Comments
 (0)