Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 148347f60f 🔖 chore(release): v0.84.0-beta.1 [skip ci]
## [Version 0.84.0-beta.1](https://github.com/lobehub/lobe-chat/compare/v0.83.9...v0.84.0-beta.1)
<sup>Released on **2023-10-09**</sup>

####  Features

- **misc**: Dockerize lobe-chat.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Dockerize lobe-chat ([1b750f8](https://github.com/lobehub/lobe-chat/commit/1b750f8))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
2023-10-09 15:26:39 +00:00
arvinxx 1b750f8466 feat: dockerize lobe-chat 2023-10-09 23:24:35 +08:00
arvinxx 4cce8401d3 🚧 wip: test for the docker release 2023-10-09 23:23:53 +08:00
7 changed files with 104 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
.next
.git
scripts
docs
.github
*.md
+3
View File
@@ -3,6 +3,7 @@ on:
push:
branches:
- main
- beta
jobs:
release:
@@ -28,3 +29,5 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }}
+14 -1
View File
@@ -1 +1,14 @@
module.exports = require('@lobehub/lint').semanticRelease;
const release = require('@lobehub/lint').semanticRelease;
module.exports = {
...release,
plugins: [
...release.plugins,
[
'@codedependant/semantic-release-docker',
{
dockerImage: 'lobe-chat',
},
],
],
};
+25
View File
@@ -2,6 +2,31 @@
# Changelog
## [Version 0.84.0-beta.1](https://github.com/lobehub/lobe-chat/compare/v0.83.9...v0.84.0-beta.1)
<sup>Released on **2023-10-09**</sup>
#### ✨ Features
- **misc**: Dockerize lobe-chat.
<br/>
<details>
<summary><kbd>Improvements and Fixes</kbd></summary>
#### What's improved
- **misc**: Dockerize lobe-chat ([1b750f8](https://github.com/lobehub/lobe-chat/commit/1b750f8))
</details>
<div align="right">
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
</div>
### [Version 0.83.9](https://github.com/lobehub/lobe-chat/compare/v0.83.8...v0.83.9)
<sup>Released on **2023-10-08**</sup>
+46
View File
@@ -0,0 +1,46 @@
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
## Install dependencies only when needed
FROM base AS builder
WORKDIR /app
COPY package.json ./
# If you want to build docker in China
RUN npm config set registry https://registry.npmmirror.com/
RUN pnpm install
COPY . .
RUN pnpm run build:docker # run build standalone for docker version
## Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"
CMD ["node", "server.js"]
+3
View File
@@ -2,6 +2,7 @@ import analyzer from '@next/bundle-analyzer';
import nextPWA from 'next-pwa';
const isProd = process.env.NODE_ENV === 'production';
const buildWithDocker = process.env.DOCKER === 'true';
const withBundleAnalyzer = analyzer({
enabled: process.env.ANALYZE === 'true',
@@ -32,6 +33,8 @@ const nextConfig = {
AGENTS_INDEX_URL: process.env.AGENTS_INDEX_URL,
PLUGINS_INDEX_URL: process.env.PLUGINS_INDEX_URL,
},
output: buildWithDocker ? 'standalone' : undefined,
};
export default isProd ? withBundleAnalyzer(withPWA(nextConfig)) : nextConfig;
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "0.83.9",
"version": "0.84.0-beta.1",
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
"keywords": [
"chatbot",
@@ -25,6 +25,7 @@
"scripts": {
"build": "next build",
"build:analyze": "ANALYZE=true next build",
"build:docker": "DOCKER=true next build",
"dev": "next dev -p 3010",
"i18n": "npm run i18n:workflow && lobe-i18n",
"i18n:workflow": "ts-node --project ./tsconfig.json scripts/i18nWorkflow/index.ts",
@@ -119,6 +120,7 @@
"zustand-utils": "^1"
},
"devDependencies": {
"@codedependant/semantic-release-docker": "^4",
"@commitlint/cli": "^17",
"@lobehub/i18n-cli": "latest",
"@lobehub/lint": "latest",