Add: Docker Compose installations with third-party chat web interfaces.

This commit is contained in:
Pawan Osman
2024-04-10 08:43:14 +03:00
parent 282509ca10
commit 86fd0df683
5 changed files with 167 additions and 0 deletions
+87
View File
@@ -0,0 +1,87 @@
# Docker Compose Deployment Guide
This guide provides instructions on how to deploy the Docker Compose applications within this project.
## Prerequisites
Before proceeding, ensure you have Docker and Docker Compose installed on your system:
- Docker: [Get Docker](https://docs.docker.com/get-docker/)
- Docker Compose: [Install Docker Compose](https://docs.docker.com/compose/install/)
## Deployment Instructions
Within this project, there are multiple Docker Compose applications. Each can be deployed using its respective `docker-compose.yaml` file. Here's how to deploy each one:
Certainly! You can use `curl` or `wget` to download the Docker Compose file directly from a given URL (if the files are hosted online and have a direct URL). Here's how you can do it in a one-liner command for each service, followed by the command to run it:
### [BetterChatGPT](https://github.com/ztjhz/BetterChatGPT)
```sh
curl -L -o docker-compose.yaml https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/bettergpt/docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
Or if you're using `wget`:
```sh
wget https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/bettergpt/docker-compose.yaml -O docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
### [ChatGPT Next Web](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web)
```sh
curl -L -o docker-compose.yaml https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/chatgpt-next-web/docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
Or with `wget`:
```sh
wget https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/chatgpt-next-web/docker-compose.yaml -O docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
### [Lobe Chat](https://github.com/lobehub/lobe-chat)
```sh
curl -L -o docker-compose.yaml https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/lobe-chat/docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
Or using `wget`:
```sh
wget https://raw.githubusercontent.com/PawanOsman/ChatGPT/main/docker-compose/lobe-chat/docker-compose.yaml -O docker-compose.yaml
docker-compose -f docker-compose.yaml up -d
```
## Managing the Applications
Once deployed, you can manage your applications with the following commands:
- To view the status of your services:
```sh
docker-compose ps
```
- To stop the services:
```sh
docker-compose down
```
- To view the logs of a service:
```sh
docker-compose logs [service-name]
```
Replace `[service-name]` with the name of the service you want to check the logs for.
## Additional Notes
- Ensure you are in the correct directory before running the `docker-compose` commands.
- Use the `-d` flag to run containers in detached mode.
- To pull the latest images before starting containers, use the command `docker-compose pull`.
Thank you for using this project. Please report any issues or provide feedback to the project maintainers.
@@ -0,0 +1,21 @@
version: '3.8' # Specify Docker Compose file version
services:
# Define the service for the web interface of ChatGPT
bettergpt:
image: pawanosman/bettergpt:latest # Use the specified Docker image for the web interface
ports:
- "5173:5173" # Map port 5173 on the host to port 5173 in the container
environment: # Set environment variables for the container
VITE_CUSTOM_API_ENDPOINT: "http://localhost:3040/v1/chat/completions"
VITE_DEFAULT_API_ENDPOINT: "http://localhost:3040/v1/chat/completions"
VITE_OPENAI_API_KEY: "anything"
depends_on:
- chatgpt # Ensure this service starts after the chatgpt service
# Define the backend service for ChatGPT
chatgpt:
image: pawanosman/chatgpt:latest # Use the specified Docker image for the backend
restart: always # Ensure the container restarts automatically if it stops
ports:
- "3040:3040" # Map port 3040 on the host to port 3040 in the container
+17
View File
@@ -0,0 +1,17 @@
# Use a Node.js base image
FROM node:19
# Set the working directory
WORKDIR /app
# Clone the project repository
RUN git clone https://github.com/ztjhz/BetterChatGPT.git /app
# Install dependencies
RUN npm install
# Expose the port the app runs on
EXPOSE 5173
# Command to run the start script
CMD ["npm", "run", "dev"]
@@ -0,0 +1,21 @@
version: '3.8' # Specify Docker Compose file version
services:
# Define the service for the web interface of ChatGPT
chatgpt-next-web:
image: yidadaa/chatgpt-next-web # Use the specified Docker image for the web interface
ports:
- "3000:3000" # Map port 3000 on the host to port 3000 in the container
environment: # Set environment variables for the container
OPENAI_API_KEY: "anything" # Placeholder for the actual OpenAI API key
BASE_URL: "http://chatgpt:3040" # URL for the backend service
CUSTOM_MODELS: "-all,+gpt-3.5-turbo" # Enable only the gpt-3.5-turbo model, disable all others
depends_on:
- chatgpt # Ensure this service starts after the chatgpt service
# Define the backend service for ChatGPT
chatgpt:
image: pawanosman/chatgpt:latest # Use the specified Docker image for the backend
restart: always # Ensure the container restarts automatically if it stops
ports:
- "3040:3040" # Map port 3040 on the host to port 3040 in the container
@@ -0,0 +1,21 @@
version: '3.8' # Specify Docker Compose file version
services:
# Define the service for the web interface of ChatGPT
lobe-chat:
image: lobehub/lobe-chat:latest # Use the specified Docker image for the web interface
restart: always
ports:
- "3210:3210" # Map port 3210 on the host to port 3210 in the container
environment: # Set environment variables for the container
OPENAI_API_KEY: "anything" # Placeholder for the actual OpenAI API key
OPENAI_PROXY_URL: "http://chatgpt:3040/v1" # URL for the backend service
depends_on:
- chatgpt # Ensure this service starts after the chatgpt service
# Define the backend service for ChatGPT
chatgpt:
image: pawanosman/chatgpt:latest # Use the specified Docker image for the backend
restart: always # Ensure the container restarts automatically if it stops
ports:
- "3040:3040" # Map port 3040 on the host to port 3040 in the container