Skip to content

Commit

Permalink
Merge pull request #1629 from arc53/easy-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain authored Feb 12, 2025
2 parents d0fb3da + bafed63 commit 1bcbfc8
Show file tree
Hide file tree
Showing 42 changed files with 1,780 additions and 695 deletions.
55 changes: 25 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<a href="https://twitter.com/docsgptai">![X (formerly Twitter) URL](https://img.shields.io/twitter/follow/docsgptai)</a>

<br>

[☁️ Cloud Version](https://app.docsgpt.cloud/)[💬 Discord](https://discord.gg/n5BX8dh8rU)[📖 Guides](https://docs.docsgpt.cloud/)
[⚡️ Quickstart](https://docs.docsgpt.cloud/quickstart)[☁️ Cloud Version](https://app.docsgpt.cloud/)[💬 Discord](https://discord.gg/n5BX8dh8rU)
<br>
[📖 Documentation](https://docs.docsgpt.cloud/)[👫 Contribute](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md)[🗞 Blog](https://blog.docsgpt.cloud/)
<br>
[👫 Contribute](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md)[🏠 Self-host](https://docs.docsgpt.cloud/Guides/How-to-use-different-LLM)[⚡️ Quickstart](https://github.com/arc53/DocsGPT#quickstart)

</div>
<div align="center">
Expand All @@ -35,6 +35,7 @@
<li><strong>🗂️ Wide Format Support:</strong> Reads PDF, DOCX, CSV, XLSX, EPUB, MD, RST, HTML, MDX, JSON, PPTX, and images.</li>
<li><strong>🌐 Web & Data Integration:</strong> Ingests from URLs, sitemaps, Reddit, GitHub and web crawlers.</li>
<li><strong>✅ Reliable Answers:</strong> Get accurate, hallucination-free responses with source citations viewable in a clean UI.</li>
<li><strong>🔑 Streamlined API Keys:</strong> Generate keys linked to your settings, documents, and models, simplifying chatbot and integration setup.</li>
<li><strong>🔗 Actionable Tooling:</strong> Connect to APIs, tools, and other services to enable LLM actions.</li>
<li><strong>🧩 Pre-built Integrations:</strong> Use readily available HTML/React chat widgets, search tools, Discord/Telegram bots, and more.</li>
<li><strong>🔌 Flexible Deployment:</strong> Works with major LLMs (OpenAI, Google, Anthropic) and local models (Ollama, llama_cpp).</li>
Expand Down Expand Up @@ -68,45 +69,39 @@ We're eager to provide personalized assistance when deploying your DocsGPT to a
> [!Note]
> Make sure you have [Docker](https://docs.docker.com/engine/install/) installed
A more detailed [Quickstart](https://docs.docsgpt.cloud/quickstart) is available in our documentation

1. Clone the repository and run the following command:
```bash
git clone https://github.com/arc53/DocsGPT.git
cd DocsGPT
```

On Mac OS or Linux, write:
1. **Clone the repository:**

```bash
git clone https://github.com/arc53/DocsGPT.git
cd DocsGPT
```

2. Run the following command:
```bash
./setup.sh
```
**For macOS and Linux:**

It will install all the dependencies and allow you to download the local model, use OpenAI or use our LLM API.
2. **Run the setup script:**

Otherwise, refer to this Guide for Windows:
```bash
./setup.sh
```

On windows:
This interactive script will guide you through setting up DocsGPT. It offers four options: using the public API, running locally, connecting to a local inference engine, or using a cloud API provider. The script will automatically configure your `.env` file and handle necessary downloads and installations based on your chosen option.

2. Create a `.env` file in your root directory and set the env variables.
It should look like this inside:
**For Windows:**

```
LLM_NAME=[docsgpt or openai or others]
API_KEY=[if LLM_NAME is openai]
```
2. **Follow the Docker Deployment Guide:**

See optional environment variables in the [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) file.
Please refer to the [Docker Deployment documentation](https://docs.docsgpt.cloud/Deploying/Docker-Deploying) for detailed step-by-step instructions on setting up DocsGPT using Docker.

3. Run the following command:
**Navigate to http://localhost:5173/**

```bash
docker compose -f deployment/docker-compose.yaml up --build
```
4. Navigate to http://localhost:5173/.
To stop DocsGPT, open a terminal in the `DocsGPT` directory and run:

To stop, just run `Ctrl + C`.
```bash
docker compose -f deployment/docker-compose.yaml down
```
(or use the specific `docker compose down` command shown after running `setup.sh`).

> [!Note]
> For development environment setup instructions, please refer to the [Development Environment Guide](https://docs.docsgpt.cloud/Deploying/Development-Environment).
Expand Down
11 changes: 11 additions & 0 deletions deployment/optional/docker-compose.optional.ollama-cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.8"
services:
ollama:
image: ollama/ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama

volumes:
ollama_data:
16 changes: 16 additions & 0 deletions deployment/optional/docker-compose.optional.ollama-gpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"
services:
ollama:
image: ollama/ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]

volumes:
ollama_data:
120 changes: 120 additions & 0 deletions docs/components/DeploymentCards.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import Image from 'next/image';

const iconMap = {
'Amazon Lightsail': '/lightsail.png',
'Railway': '/railway.png',
'Civo Compute Cloud': '/civo.png',
'DigitalOcean Droplet': '/digitalocean.png',
'Kamatera Cloud': '/kamatera.png',
};


export function DeploymentCards({ items }) {
return (
<>
<div className="deployment-cards">
{items.map(({ title, link, description }) => {
const isExternal = link.startsWith('https://');
const iconSrc = iconMap[title] || '/default-icon.png'; // Default icon if not found

return (
<div
key={title}
className={`card${isExternal ? ' external' : ''}`}
>
<a href={link} target={isExternal ? '_blank' : undefined} rel="noopener noreferrer" className="card-link-wrapper">
<div className="card-icon-container">
{iconSrc && <div className="card-icon"><Image src={iconSrc} alt={title} width={32} height={32} /></div>} {/* Reduced icon size */}
</div>
<h3 className="card-title">{title}</h3>
{description && <p className="card-description">{description}</p>}
<p className="card-url">{new URL(link).hostname.replace('www.', '')}</p>
</a>
</div>
);
})}
</div>

<style jsx>{`
.deployment-cards {
margin-top: 24px;
display: grid;
grid-template-columns: 1fr;
gap: 16px;
}
@media (min-width: 768px) {
.deployment-cards {
grid-template-columns: 1fr 1fr;
}
}
.card {
background-color: #222222;
border-radius: 8px;
padding: 16px;
transition: background-color 0.3s;
position: relative;
color: #ffffff;
/* Make the card a flex container */
display: flex;
flex-direction: column;
align-items: center; /* Center horizontally */
justify-content: center; /* Center vertically */
height: 100%; /* Fill the height of the grid cell */
}
.card:hover {
background-color: #333333;
}
.card.external::after {
content: "↗";
position: absolute;
top: 12px; /* Adjusted position */
right: 12px; /* Adjusted position */
color: #ffffff;
font-size: 0.7em; /* Reduced size */
opacity: 0.8; /* Slightly faded */
}
.card-link-wrapper {
display: flex;
flex-direction: column;
align-items:center;
color: inherit;
text-decoration: none;
width:100%; /* Important: make link wrapper take full width */
}
.card-icon-container{
display:flex;
justify-content:center;
width: 100%;
margin-bottom: 8px; /* Space between icon and title */
}
.card-icon {
display: block;
margin: 0 auto;
}
.card-title {
font-weight: 600;
margin-bottom: 4px;
font-size: 16px;
text-align: center;
color: #f0f0f0; /* Lighter title color if needed */
}
.card-description {
margin-bottom: 0;
font-size: 13px;
color: #aaaaaa;
text-align: center;
line-height: 1.4;
}
.card-url {
margin-top: 8px; /*Keep space consistent */
font-size: 11px;
color: #777777;
text-align: center;
font-family: monospace;
}
`}</style>
</>
);
}
Loading

0 comments on commit 1bcbfc8

Please sign in to comment.