소스 검색

feat(docker): add PM2_INSTANCES variable and update entrypoint script… (#14083)

tags/1.0.0
Wu Tianwei 8 달 전
부모
커밋
252d2c425b
No account linked to committer's email address
5개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    0
      docker/docker-compose-template.yaml
  2. 1
    0
      docker/docker-compose.yaml
  3. 1
    1
      web/Dockerfile
  4. 2
    0
      web/README.md
  5. 1
    1
      web/docker/entrypoint.sh

+ 1
- 0
docker/docker-compose-template.yaml 파일 보기

MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai} MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai}
TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-} TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-}
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-} INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-}
PM2_INSTANCES: ${PM2_INSTANCES:-2}


# The postgres database. # The postgres database.
db: db:

+ 1
- 0
docker/docker-compose.yaml 파일 보기

MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai} MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai}
TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-} TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-}
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-} INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-}
PM2_INSTANCES: ${PM2_INSTANCES:-2}


# The postgres database. # The postgres database.
db: db:

+ 1
- 1
web/Dockerfile 파일 보기

ENV MARKETPLACE_URL=http://127.0.0.1:5001 ENV MARKETPLACE_URL=http://127.0.0.1:5001
ENV PORT=3000 ENV PORT=3000
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
ENV PM2_INSTANCES=2


# set timezone # set timezone
ENV TZ=UTC ENV TZ=UTC
COPY --from=builder /app/web/.next/standalone ./ COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static COPY --from=builder /app/web/.next/static ./.next/static


COPY docker/pm2.json ./pm2.json
COPY docker/entrypoint.sh ./entrypoint.sh COPY docker/entrypoint.sh ./entrypoint.sh





+ 2
- 0
web/README.md 파일 보기

pnpm run start --port=3001 --host=0.0.0.0 pnpm run start --port=3001 --host=0.0.0.0
``` ```


If you want to customize the number of instances launched by PM2, you can configure `PM2_INSTANCES` in `docker-compose.yaml` or `Dockerfile`.

## Storybook ## Storybook


This project uses [Storybook](https://storybook.js.org/) for UI component development. This project uses [Storybook](https://storybook.js.org/) for UI component development.

+ 1
- 1
web/docker/entrypoint.sh 파일 보기

export NEXT_PUBLIC_TOP_K_MAX_VALUE=${TOP_K_MAX_VALUE} export NEXT_PUBLIC_TOP_K_MAX_VALUE=${TOP_K_MAX_VALUE}
export NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH} export NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH}


pm2 start ./pm2.json --no-daemon
pm2 start /app/web/server.js --name dify-web --cwd /app/web -i ${PM2_INSTANCES} --no-daemon

Loading…
취소
저장