mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
complete docker setup
This commit is contained in:
parent
ff7b016190
commit
52e529dcbe
12 changed files with 26 additions and 158506 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -48,5 +48,6 @@ bower_components/
|
||||||
cache.json
|
cache.json
|
||||||
api/data/
|
api/data/
|
||||||
.eslintrc.js
|
.eslintrc.js
|
||||||
|
docker-compose.yml
|
||||||
|
|
||||||
src/style - official.css
|
src/style - official.css
|
||||||
158490
client/public/main.js
158490
client/public/main.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -23,8 +23,8 @@ export default function Conversation({
|
||||||
const { modelMap } = useSelector((state) => state.models);
|
const { modelMap } = useSelector((state) => state.models);
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { trigger } = manualSWR(`http://localhost:3080/messages/${id}`, 'get');
|
const { trigger } = manualSWR(`http://api:3080/messages/${id}`, 'get');
|
||||||
const rename = manualSWR(`http://localhost:3080/convos/update`, 'post');
|
const rename = manualSWR(`http://api:3080/convos/update`, 'post');
|
||||||
|
|
||||||
const clickHandler = async () => {
|
const clickHandler = async () => {
|
||||||
if (conversationId === id) {
|
if (conversationId === id) {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { setMessages } from '~/store/messageSlice';
|
||||||
export default function DeleteButton({ conversationId, renaming, cancelHandler }) {
|
export default function DeleteButton({ conversationId, renaming, cancelHandler }) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { trigger } = manualSWR(
|
const { trigger } = manualSWR(
|
||||||
`http://localhost:3080/convos/clear`,
|
`http://api:3080/convos/clear`,
|
||||||
'post',
|
'post',
|
||||||
() => {
|
() => {
|
||||||
dispatch(setMessages([]));
|
dispatch(setMessages([]));
|
||||||
|
|
|
||||||
|
|
@ -59,13 +59,18 @@ export default function Message({
|
||||||
'w-full border-b border-black/10 bg-gray-50 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-100 dark:bg-[#444654]';
|
'w-full border-b border-black/10 bg-gray-50 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-100 dark:bg-[#444654]';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notUser && backgroundColor || sender === 'bingai') {
|
if ((notUser && backgroundColor) || sender === 'bingai') {
|
||||||
icon = (
|
icon = (
|
||||||
<div
|
<div
|
||||||
style={{ backgroundColor }}
|
style={{ backgroundColor }}
|
||||||
className="relative flex h-[30px] w-[30px] items-center justify-center rounded-sm p-1 text-white"
|
className="relative flex h-[30px] w-[30px] items-center justify-center rounded-sm p-1 text-white"
|
||||||
>
|
>
|
||||||
{sender === 'bingai' ? <BingIcon /> : <GPTIcon />}
|
{sender === 'bingai' ? <BingIcon /> : <GPTIcon />}
|
||||||
|
{error && (
|
||||||
|
<span className="absolute right-0 top-[20px] -mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-white bg-red-500 text-[10px] text-white">
|
||||||
|
!
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export default function ModelDialog({ mutate, modelMap }) {
|
||||||
const [saveText, setSaveText] = useState('Save');
|
const [saveText, setSaveText] = useState('Save');
|
||||||
const [required, setRequired] = useState(false);
|
const [required, setRequired] = useState(false);
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
const updateCustomGpt = manualSWR(`http://localhost:3080/customGpts/`, 'post');
|
const updateCustomGpt = manualSWR(`http://api:3080/customGpts/`, 'post');
|
||||||
|
|
||||||
const submitHandler = (e) => {
|
const submitHandler = (e) => {
|
||||||
if (chatGptLabel.length === 0) {
|
if (chatGptLabel.length === 0) {
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ export default function ModelMenu() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { model, customModel } = useSelector((state) => state.submit);
|
const { model, customModel } = useSelector((state) => state.submit);
|
||||||
const { models, modelMap, initial } = useSelector((state) => state.models);
|
const { models, modelMap, initial } = useSelector((state) => state.models);
|
||||||
const { trigger } = manualSWR(`http://localhost:3080/customGpts`, 'get', (res) => {
|
const { trigger } = manualSWR(`http://api:3080/customGpts`, 'get', (res) => {
|
||||||
console.log('models data (response)', res);
|
|
||||||
if (models.length + res.length === models.length) {
|
if (models.length + res.length === models.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ export default function ClearConvos() {
|
||||||
const { mutate } = useSWRConfig()
|
const { mutate } = useSWRConfig()
|
||||||
|
|
||||||
const { trigger } = manualSWR(
|
const { trigger } = manualSWR(
|
||||||
`http://localhost:3080/convos/clear`,
|
`http://api:3080/convos/clear`,
|
||||||
'post',
|
'post',
|
||||||
() => {
|
() => {
|
||||||
dispatch(setMessages([]));
|
dispatch(setMessages([]));
|
||||||
dispatch(setConversation({ error: false, title: 'New chat', conversationId: null, parentMessageId: null }));
|
dispatch(setConversation({ error: false, title: 'New chat', conversationId: null, parentMessageId: null }));
|
||||||
mutate(`http://localhost:3080/convos`);
|
mutate(`http://api:3080/convos`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default function Nav() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data, isLoading, mutate } = swr(
|
const { data, isLoading, mutate } = swr(
|
||||||
`http://localhost:3080/convos?pageNumber=${pageNumber}`
|
`http://api:3080/convos?pageNumber=${pageNumber}`
|
||||||
, onSuccess);
|
, onSuccess);
|
||||||
const containerRef = useRef(null);
|
const containerRef = useRef(null);
|
||||||
const scrollPositionRef = useRef(null);
|
const scrollPositionRef = useRef(null);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export default function handleSubmit({
|
||||||
chatGptLabel,
|
chatGptLabel,
|
||||||
promptPrefix
|
promptPrefix
|
||||||
}) {
|
}) {
|
||||||
const endpoint = `http://localhost:3080/ask`;
|
const endpoint = `http://api:3080/ask`;
|
||||||
let payload = { model, text, chatGptLabel, promptPrefix };
|
let payload = { model, text, chatGptLabel, promptPrefix };
|
||||||
if (convo.conversationId && convo.parentMessageId) {
|
if (convo.conversationId && convo.parentMessageId) {
|
||||||
payload = {
|
payload = {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ services:
|
||||||
image: react-app
|
image: react-app
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3050:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./client:/client
|
- ./client:/client
|
||||||
- /client/node_modules
|
- /client/node_modules
|
||||||
|
|
@ -16,8 +16,14 @@ services:
|
||||||
api:
|
api:
|
||||||
image: node-api
|
image: node-api
|
||||||
restart: always
|
restart: always
|
||||||
|
environment:
|
||||||
|
- PORT=3080
|
||||||
|
- MONGO_URI=mongodb://mongodb:27017
|
||||||
|
- OPENAI_KEY=
|
||||||
|
- CHATGPT_TOKEN=""
|
||||||
|
- BING_TOKEN=""
|
||||||
ports:
|
ports:
|
||||||
- "9000:9000"
|
- "3080:3080"
|
||||||
volumes:
|
volumes:
|
||||||
- ./api:/api
|
- ./api:/api
|
||||||
- /api/node_modules
|
- /api/node_modules
|
||||||
|
|
@ -32,7 +38,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./data-node:/data/db
|
- ./data-node:/data/db
|
||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 27020:27017
|
||||||
command: mongod --noauth
|
command: mongod --noauth
|
||||||
networks:
|
networks:
|
||||||
- webappnetwork
|
- webappnetwork
|
||||||
Loading…
Add table
Add a link
Reference in a new issue