add authrorization to npx and docker installation
This commit is contained in:
parent
eee6b4d74b
commit
626e1b29f8
|
|
@ -1,7 +1,12 @@
|
||||||
# Build local monorepo image
|
# Build local monorepo image
|
||||||
# docker build --no-cache -t flowise .
|
# docker build --no-cache -t flowise .
|
||||||
|
|
||||||
# Run image
|
# Run image
|
||||||
# docker run -d -p 3000:3000 flowise
|
# docker run -d -p 3000:3000 flowise
|
||||||
|
|
||||||
|
# Run image with authorization
|
||||||
|
# docker run -d -e USERNAME=user -e PASSWORD=1234 -p 3000:3000 flowise
|
||||||
|
|
||||||
FROM node:18-alpine
|
FROM node:18-alpine
|
||||||
RUN apk add --update libc6-compat
|
RUN apk add --update libc6-compat
|
||||||
|
|
||||||
|
|
|
||||||
14
README.md
14
README.md
|
|
@ -19,6 +19,12 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
|
||||||
npx flowise start
|
npx flowise start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With username & password
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx flowise start --USERNAME=user --PASSWORD=1234
|
||||||
|
```
|
||||||
|
|
||||||
3. Open [http://localhost:3000](http://localhost:3000)
|
3. Open [http://localhost:3000](http://localhost:3000)
|
||||||
|
|
||||||
## 🐳 Docker
|
## 🐳 Docker
|
||||||
|
|
@ -38,9 +44,17 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
|
||||||
docker build --no-cache -t flowise .
|
docker build --no-cache -t flowise .
|
||||||
```
|
```
|
||||||
2. Run image:
|
2. Run image:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d --name flowise -p 3000:3000 flowise
|
docker run -d --name flowise -p 3000:3000 flowise
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With username & password
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d -e USERNAME=user -e PASSWORD=1234 --name flowise -p 3000:3000 flowise
|
||||||
|
```
|
||||||
|
|
||||||
3. Stop image:
|
3. Stop image:
|
||||||
```bash
|
```bash
|
||||||
docker stop flowise
|
docker stop flowise
|
||||||
|
|
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
PORT=3000
|
PORT=3000
|
||||||
|
USERNAME=user
|
||||||
|
PASSWORD=1234
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Flowise Docker Hub Image
|
||||||
|
|
||||||
|
Starts Flowise from [DockerHub Image](https://hub.docker.com/repository/docker/flowiseai/flowise/general)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. Create `.env` file and specify the `PORT` (refer to `.env.example`)
|
||||||
|
2. `docker-compose up -d`
|
||||||
|
3. Open [http://localhost:3000](http://localhost:3000)
|
||||||
|
4. You can bring the containers down by `docker-compose stop`
|
||||||
|
|
||||||
|
## With Authrorization
|
||||||
|
|
||||||
|
1. Create `.env` file and specify the `PORT`, `USERNAME`, and `PASSWORD` (refer to `.env.example`)
|
||||||
|
2. Pass `USERNAME` and `PASSWORD` to the `docker-compose.yml` file:
|
||||||
|
```
|
||||||
|
environment:
|
||||||
|
- PORT=${PORT}
|
||||||
|
- USERNAME=${USERNAME}
|
||||||
|
- PASSWORD=${PASSWORD}
|
||||||
|
```
|
||||||
|
3. `docker-compose up -d`
|
||||||
|
4. Open [http://localhost:3000](http://localhost:3000)
|
||||||
|
5. You can bring the containers down by `docker-compose stop`
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Command } from '@oclif/core'
|
import { Command, Flags } from '@oclif/core'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import * as Server from '../index'
|
import * as Server from '../index'
|
||||||
import * as DataSource from '../DataSource'
|
import * as DataSource from '../DataSource'
|
||||||
|
|
@ -14,6 +14,10 @@ let processExitCode = EXIT_CODE.SUCCESS
|
||||||
|
|
||||||
export default class Start extends Command {
|
export default class Start extends Command {
|
||||||
static args = []
|
static args = []
|
||||||
|
static flags = {
|
||||||
|
USERNAME: Flags.string(),
|
||||||
|
PASSWORD: Flags.string()
|
||||||
|
}
|
||||||
|
|
||||||
async stopProcess() {
|
async stopProcess() {
|
||||||
console.info('Shutting down Flowise...')
|
console.info('Shutting down Flowise...')
|
||||||
|
|
@ -43,6 +47,10 @@ export default class Start extends Command {
|
||||||
console.error('uncaughtException: ', err)
|
console.error('uncaughtException: ', err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { flags } = await this.parse(Start)
|
||||||
|
if (flags.USERNAME) process.env.USERNAME = flags.USERNAME
|
||||||
|
if (flags.PASSWORD) process.env.PASSWORD = flags.PASSWORD
|
||||||
|
|
||||||
await (async () => {
|
await (async () => {
|
||||||
try {
|
try {
|
||||||
this.log('Starting Flowise...')
|
this.log('Starting Flowise...')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue