Skip to content

Commit

Permalink
Revert "Jan integrates Cortex"
Browse files Browse the repository at this point in the history
This reverts commit ad6fbea

Revert "chore: add engine logo from local instead of metadata logo (#3363)"

This reverts commit ad6fbea.

Revert "fix: LaTex formula render issue (#3353)"

This reverts commit 3b2c84c.

Revert "chore: minor ui improvement (#3352)"

This reverts commit 6dd387d.

Revert "fix: failed to relaunch app to update (#3351)"

This reverts commit fcaf98a.

Revert "chore: add back GPU information to system monitoring bar (#3350)"

This reverts commit 03455a9.

Revert "fix: empty model page not shown when delete all threads and models (#3343)"

This reverts commit 9e29fcd.

Revert "feat: allow user configure remote model from my model (#3348)"

This reverts commit fdab8af.

Revert "chore: ui fix button outline for configure cloud model (#3347)"

This reverts commit fe8ed1f.

Revert "feat: move icon create new thread into top panel (#3346)"

This reverts commit 46cb1b4.

Revert "chore(UI): update experience model dropdown (#3342)"

This reverts commit 8b44613.

Revert "Chore/simple bug template and correct a copy (#3344)"

This reverts commit 23cd5fd.

Revert "chore(ui): fix alignment loader starter screen (#3338)"

This reverts commit e9f5d2f.

Revert "Increase retry upload to R2 to 5 times (#3337)"

This reverts commit dcfb497.

Revert "fix: broken jan build - add log trace (jan.log) (#3336)"

This reverts commit 77422c3.

Revert "chore: disable quick ask (#3334)"

This reverts commit 6e4b6b0.

Revert "fix: update legacy path (#3328)"

This reverts commit 5eb1121.

Revert "chore: add cortex version (#3318)"

This reverts commit 6058764.

Revert "fix: broken app due to incorrect api path (#3316)"

This reverts commit 3de4eab.

Revert "feat: modal waiting cortex (#3306)"

This reverts commit 1f5168d.

Revert "fix: refresh should not create new thread (#3314)"

This reverts commit 624d077.

Revert "fix: avoid lose title threads (#3307)"

This reverts commit a4f5fda.

Revert "feat: change data folder (#3309)"

This reverts commit b43242b.

Revert "feat: embed cortex into jan as a js module (#3305)"

This reverts commit b348110.

Revert "fix: migration item in setting detail omit buttons (#3298)"

This reverts commit 709204b.

Revert "fix: merge gpu arch and os tensorrt models (#3299)"

This reverts commit aa7dbdc.

Revert "chore: update cortex new version (#3300)"

This reverts commit 6020979.

Revert "fix: engine logo on model dropdown (#3291)"

This reverts commit 8eb8611.

Revert "fix: icon setting can close and open right panel (#3295)"

This reverts commit be31e93.

Revert "fix: error while importing local model is not shown (#3294)"

This reverts commit 26be941.

Revert "fix: add lower case quantization support (#3293)"

This reverts commit 3135ccc.

Revert "fix: onnx can't be selected in download model modal (#3283)"

This reverts commit 2521e1d.

Revert "feat: add chunk count (#3290)"

This reverts commit bad481b.

Revert "fix: RAM always show 0% (#3287)"

This reverts commit 2201e6c.

Revert "fix: remote engine should not allow reinit (#3284)"

This reverts commit 98abff0.

Revert "chore": update minor UI (#3281)"

This reverts commit 105a9aa.

Revert "chore: update z-index tooltip (#3280)"

This reverts commit 5a81865.

Revert "feat: add nvidia engine (#3279)"

This reverts commit 8372f30.

Revert "fix: migration wrong directory (#3278)"

This reverts commit 7fb1354.

Revert "fix: clearer app loading prompt (#3275)"

This reverts commit 44a6401.

Revert "fix: allow user to reinit engine from settings page (#3277)"

This reverts commit 57cf3c7.

Revert "feat: enable copy over instructions (#3266)"

This reverts commit 2074511.

Revert "chore: toast message on model import fail with reason (#3276)"

This reverts commit 3bebdfe.

Revert "fix: should not let second instance terminate cortex (#3274)"

This reverts commit d074a5a.

Revert "chore: remnove focus button (#3272)"

This reverts commit 07fa79e.

Revert "chore: update hub search result (#3273)"

This reverts commit 10b4a90.

Revert "chore: temporary hidden import model (#3270)"

This reverts commit db5d8ab.

Revert "fix: set cortex data folder path when starting jan (#3252)"

This reverts commit 91c77ed.

Revert "fix: remote model added manually does not shown in model drop down (#3261)"

This reverts commit 224ca3f.

Revert "feat: add more options for cortex popup (#3236)"

This reverts commit 5e06ed8.

Revert "feat: manage cloud models from threads screen (#3223)"

This reverts commit 37a3c4f.

Revert "chore: check the legacy incompatible message type (#3248)"

This reverts commit c10caf8.

Revert "chore: minor copy for grammar (#3235)"

This reverts commit f0f2307.

Revert "fix: add back normalize message function (#3234)"

This reverts commit 83579df.

Revert "chore: update conditional starter screen after cortex load (#3227)"

This reverts commit 4d3a97f.

Revert "fix: broken status parse due to empty category (#3233)"

This reverts commit 68714ee.

Revert "feat: make scroll area type auto for make default visible scrollbar (#3220)"

This reverts commit 13428d6.

Revert "fix: update new api from cortex to support 0.5.0 (#3221)"

This reverts commit ec9b5bf.

Revert "feat: new starter screen (#3217)"

This reverts commit e8ee694.

Revert "bump-cortex-0.5.0-1 (#3218)"

This reverts commit 5369da7.

Revert "Deprecate Docker and K8s (#3219)"

This reverts commit 7611a05.

Revert "chore: set container max width for chat message and new hub screen (#3213)"

This reverts commit 007daa7.

Revert "feat: integrating cortex (#3001)"

This reverts commit 101268f.
  • Loading branch information
louis-jan committed Aug 15, 2024
1 parent ad6fbea commit a699f8f
Show file tree
Hide file tree
Showing 595 changed files with 30,373 additions and 23,226 deletions.
37 changes: 0 additions & 37 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

33 changes: 15 additions & 18 deletions .github/workflows/jan-electron-linter-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
run: |
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}})" >> $GITHUB_ENV
# - name: 'Config report portal'
# run: |
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: 'Config report portal'
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: Linter and test
run: |
Expand Down Expand Up @@ -147,10 +147,10 @@ jobs:
run: |
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
# - name: 'Config report portal'
# shell: bash
# run: |
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: 'Config report portal'
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: Linter and test
shell: powershell
Expand Down Expand Up @@ -195,14 +195,11 @@ jobs:
run: |
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
# - name: 'Config report portal'
# shell: bash
# run: |
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: 'Config report portal'
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: Setup node-gyp - distutils
run: pip3 install --upgrade setuptools

- name: Linter and test
shell: powershell
run: |
Expand Down Expand Up @@ -278,10 +275,10 @@ jobs:
run: |
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
# - name: 'Config report portal'
# shell: bash
# run: |
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: 'Config report portal'
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
- name: Linter and test
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/jan-server-build-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker Builder - Nightly / Manual

on:
push:
branches:
- main
- feature/helmchart-and-ci-jan-server
paths-ignore:
- 'README.md'
- 'docs/**'
schedule:
- cron: '0 21 * * 1,2,3' # At 8 PM UTC on Monday, Tuesday, and Wednesday which is 4 AM UTC+7 Tuesday, Wednesday, and Thursday
workflow_dispatch:

jobs:
# Job create Update app version based on latest release tag with build number and save to output
get-update-version:
uses: ./.github/workflows/template-get-update-version.yml

build-cpu:
uses: ./.github/workflows/template-build-jan-server.yml
permissions:
packages: write
secrets: inherit
needs: [get-update-version]
with:
dockerfile_path: ./Dockerfile
docker_image_tag: "ghcr.io/janhq/jan-server:dev-cpu-latest,ghcr.io/janhq/jan-server:dev-cpu-${{ needs.get-update-version.outputs.new_version }}"

build-gpu:
uses: ./.github/workflows/template-build-jan-server.yml
permissions:
packages: write
secrets: inherit
needs: [get-update-version]
with:
dockerfile_path: ./Dockerfile.gpu
docker_image_tag: "ghcr.io/janhq/jan-server:dev-cuda-12.2-latest,ghcr.io/janhq/jan-server:dev-cuda-12.2-${{ needs.get-update-version.outputs.new_version }}"


30 changes: 30 additions & 0 deletions .github/workflows/jan-server-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Builder - Tag

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]

jobs:
# Job create Update app version based on latest release tag with build number and save to output
get-update-version:
uses: ./.github/workflows/template-get-update-version.yml

build-cpu:
permissions:
packages: write
uses: ./.github/workflows/template-build-jan-server.yml
secrets: inherit
needs: [get-update-version]
with:
dockerfile_path: ./Dockerfile
docker_image_tag: "ghcr.io/janhq/jan-server:cpu-latest,ghcr.io/janhq/jan-server:cpu-${{ needs.get-update-version.outputs.new_version }}"

build-gpu:
permissions:
packages: write
uses: ./.github/workflows/template-build-jan-server.yml
secrets: inherit
needs: [get-update-version]
with:
dockerfile_path: ./Dockerfile.gpu
docker_image_tag: "ghcr.io/janhq/jan-server:cuda-12.2-latest,ghcr.io/janhq/jan-server:cuda-12.2-${{ needs.get-update-version.outputs.new_version }}"
1 change: 0 additions & 1 deletion .github/workflows/template-build-linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: "true"
AWS_MAX_ATTEMPTS: "5"

- name: Build and publish app to github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/template-build-macos-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ jobs:
with:
node-version: 20

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install jq
uses: dcarbone/[email protected]

Expand Down Expand Up @@ -135,7 +130,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_EC2_METADATA_DISABLED: "true"
AWS_MAX_ATTEMPTS: "5"

- name: Build and publish app to github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/template-build-macos-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ jobs:
with:
node-version: 20

- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install jq
uses: dcarbone/[email protected]

Expand Down Expand Up @@ -135,7 +130,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_EC2_METADATA_DISABLED: "true"
AWS_MAX_ATTEMPTS: "5"

- name: Build and publish app to github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/template-build-windows-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_EC2_METADATA_DISABLED: "true"
AWS_MAX_ATTEMPTS: "5"

- name: Build app and publish app to github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ yarn.lock
dist
build
.DS_Store
electron/resources/win/*
electron/resources/linux/*
electron/resources/mac/*
electron/renderer
electron/models
electron/docs
Expand Down
60 changes: 60 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM node:20-bookworm AS base

# 1. Install dependencies only when needed
FROM base AS builder

# Install g++ 11
RUN apt update && apt install -y gcc-11 g++-11 cpp-11 jq xsel && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install dependencies based on the preferred package manager
COPY . ./

RUN export NITRO_VERSION=$(cat extensions/inference-nitro-extension/bin/version.txt) && \
jq --arg nitroVersion $NITRO_VERSION '(.scripts."downloadnitro:linux" | gsub("\\${NITRO_VERSION}"; $nitroVersion)) | gsub("\r"; "")' extensions/inference-nitro-extension/package.json > /tmp/newcommand.txt && export NEW_COMMAND=$(sed 's/^"//;s/"$//' /tmp/newcommand.txt) && jq --arg newCommand "$NEW_COMMAND" '.scripts."downloadnitro:linux" = $newCommand' extensions/inference-nitro-extension/package.json > /tmp/package.json && mv /tmp/package.json extensions/inference-nitro-extension/package.json
RUN make install-and-build

# # 2. Rebuild the source code only when needed
FROM base AS runner

# Install g++ 11
RUN apt update && apt install -y gcc-11 g++-11 cpp-11 jq xsel && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy the package.json and yarn.lock of root yarn space to leverage Docker cache
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules/
COPY --from=builder /app/yarn.lock ./yarn.lock

# Copy the package.json, yarn.lock, and build output of server yarn space to leverage Docker cache
COPY --from=builder /app/core ./core/
COPY --from=builder /app/server ./server/
RUN cd core && yarn install && yarn run build
RUN yarn workspace @janhq/server install && yarn workspace @janhq/server build
COPY --from=builder /app/docs/openapi ./docs/openapi/

# Copy pre-install dependencies
COPY --from=builder /app/pre-install ./pre-install/

# Copy the package.json, yarn.lock, and output of web yarn space to leverage Docker cache
COPY --from=builder /app/joi ./joi/
COPY --from=builder /app/web ./web/

RUN yarn workspace @janhq/joi install && yarn workspace @janhq/joi build
RUN yarn workspace @janhq/web install

RUN npm install -g serve@latest

EXPOSE 1337 3000 3928

ENV JAN_API_HOST 0.0.0.0
ENV JAN_API_PORT 1337

ENV API_BASE_URL http://localhost:1337

CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace @janhq/web build && cd web && npx serve out & cd server && node build/main.js"]

# docker build -t jan .
# docker run -p 1337:1337 -p 3000:3000 -p 3928:3928 jan
87 changes: 87 additions & 0 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Please change the base image to the appropriate CUDA version base on NVIDIA Driver Compatibility
# Run nvidia-smi to check the CUDA version and the corresponding driver version
# Then update the base image to the appropriate CUDA version refer https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda/tags

FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS base

# 1. Install dependencies only when needed
FROM base AS builder

# Install g++ 11
RUN apt update && apt install -y gcc-11 g++-11 cpp-11 jq xsel curl gnupg make python3-dev && curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt install nodejs -y && rm -rf /var/lib/apt/lists/*

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

RUN npm install -g yarn

WORKDIR /app

# Install dependencies based on the preferred package manager
COPY . ./

RUN export NITRO_VERSION=$(cat extensions/inference-nitro-extension/bin/version.txt) && \
jq --arg nitroVersion $NITRO_VERSION '(.scripts."downloadnitro:linux" | gsub("\\${NITRO_VERSION}"; $nitroVersion)) | gsub("\r"; "")' extensions/inference-nitro-extension/package.json > /tmp/newcommand.txt && export NEW_COMMAND=$(sed 's/^"//;s/"$//' /tmp/newcommand.txt) && jq --arg newCommand "$NEW_COMMAND" '.scripts."downloadnitro:linux" = $newCommand' extensions/inference-nitro-extension/package.json > /tmp/package.json && mv /tmp/package.json extensions/inference-nitro-extension/package.json
RUN make install-and-build

# # 2. Rebuild the source code only when needed
FROM base AS runner

# Install g++ 11
RUN apt update && apt install -y gcc-11 g++-11 cpp-11 jq xsel curl gnupg make python3-dev && curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install nodejs -y && rm -rf /var/lib/apt/lists/*

# Update alternatives for GCC and related tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110

RUN npm install -g yarn

WORKDIR /app

# Copy the package.json and yarn.lock of root yarn space to leverage Docker cache
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules/
COPY --from=builder /app/yarn.lock ./yarn.lock

# Copy the package.json, yarn.lock, and build output of server yarn space to leverage Docker cache
COPY --from=builder /app/core ./core/
COPY --from=builder /app/server ./server/
RUN cd core && yarn install && yarn run build
RUN yarn workspace @janhq/server install && yarn workspace @janhq/server build
COPY --from=builder /app/docs/openapi ./docs/openapi/

# Copy pre-install dependencies
COPY --from=builder /app/pre-install ./pre-install/

# Copy the package.json, yarn.lock, and output of web yarn space to leverage Docker cache
COPY --from=builder /app/joi ./joi/
COPY --from=builder /app/web ./web/

RUN yarn workspace @janhq/joi install && yarn workspace @janhq/joi build
RUN yarn workspace @janhq/web install

RUN npm install -g serve@latest

EXPOSE 1337 3000 3928

ENV LD_LIBRARY_PATH=/usr/local/cuda/targets/x86_64-linux/lib:/usr/local/cuda-12.0/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

ENV JAN_API_HOST 0.0.0.0
ENV JAN_API_PORT 1337

ENV API_BASE_URL http://localhost:1337

CMD ["sh", "-c", "export NODE_ENV=production && yarn workspace @janhq/web build && cd web && npx serve out & cd server && node build/main.js"]

# pre-requisites: nvidia-docker
# docker build -t jan-gpu . -f Dockerfile.gpu
# docker run -p 1337:1337 -p 3000:3000 -p 3928:3928 --gpus all jan-gpu
Loading

0 comments on commit a699f8f

Please sign in to comment.