Skip to content

Commit

Permalink
Make the docker part more understandable and beginner friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinsws committed Sep 3, 2024
1 parent 94a0f59 commit 5efb198
Showing 1 changed file with 42 additions and 61 deletions.
103 changes: 42 additions & 61 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtu

## Setup
### With local environment
> **⚠️ Warning:** For local Weaviate vector database setup, please refer to [Weaviate Docs](https://weaviate.io/developers/weaviate/quickstart).
> **⚠️ Warning:** To change the local Weaviate vector database setup, please refer to [Weaviate Docs](https://weaviate.io/developers/weaviate/quickstart).
- Check python version: `python --version` (should be 3.12)
- Install packages: `pip install -r requirements.txt`
- Create an `application.local.yml` file in the root directory. This file includes configurations that can be used by the application.
Expand Down Expand Up @@ -59,86 +59,67 @@ Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtu
APPLICATION_YML_PATH=<path-to-your-application-yml-file> LLM_CONFIG_PATH=<path-to-your-llm-config-yml> uvicorn app.main:app --reload
```
- Access API docs: http://localhost:8000/docs
-
### Getting Started with Docker

### With docker
Pyris can be deployed using Docker, which provides an easy way to set up the application in a consistent environment.
Below are the instructions for setting up Pyris using Docker.
Deploying Pyris using Docker is a straightforward way to set up the application in a consistent environment. Here's how you can do it:

#### Prerequisites
- Ensure Docker and Docker Compose are installed on your machine.
- Clone the Pyris repository to your local machine.
-
#### Setup Instructions
**Build and Run the Containers**

1. **Build and Run the Containers**
The essential part of setting up Pyris with Docker is building and running the containers. Docker Compose is used to manage the different services, including Pyris, Weaviate, and Nginx, for both development and production environments.

You can run Pyris in different environments: development or production. Docker Compose is used to orchestrate the different services, including Pyris, Weaviate, and Nginx.
- **For Development:**

- **For Development:**
To start the development environment, run:

Use the following command to start the development environment:

```bash
docker-compose -f docker-compose/pyris-dev.yml up --build
```

This command will:
- Build the Pyris application from the Dockerfile.
- Start the Pyris application along with Weaviate in development mode.
- Mount the local configuration files (`application.local.yml` and `llm-config.local.yml`) for easy modification.

The application will be available at `http://localhost:8000`.

- **For Production:**

Use the following command to start the production environment:

```bash
docker-compose -f docker-compose/pyris-production.yml up -d
```
```bash
docker-compose -f docker-compose/pyris-dev.yml up --build
```

This command will:
- Pull the latest Pyris image from the GitHub Container Registry.
- Start the Pyris application along with Weaviate and Nginx in production mode.
- Nginx will serve as a reverse proxy, handling SSL termination if certificates are provided.
This command will:
- Build the Pyris application.
- Start the Pyris application along with Weaviate in development mode.
- Mount local configuration files for easy modification.

The application will be available at `https://<your-domain>`.
The application will be available at `http://localhost:8000`.

2. **Configuration**
- **For Production:**

- **Weaviate**: Weaviate is configured via the `weaviate.yml` file. By default, it runs on port 8001.
- **Pyris Application**: The Pyris application configuration is handled through environment variables and mounted YAML configuration files.
- **Nginx**: Nginx is used for handling requests in a production environment and is configured via `nginx.yml`.
To start the production environment, run:

3. **Accessing the Application**
```bash
docker-compose -f docker-compose/pyris-production.yml up -d
```

- For development, access the API documentation at: `http://localhost:8000/docs`
- For production, access the application at your domain (e.g., `https://<your-domain>`).
This command will:
- Pull the latest Pyris image from the GitHub Container Registry.
- Start Pyris along with Weaviate and Nginx in production mode.
- Nginx will handle SSL and serve as a reverse proxy.

4. **Stopping the Containers**
The application will be available at `https://<your-domain>`.

To stop the running containers, use:
#### Additional Steps (Optional)

```bash
docker-compose -f docker-compose/pyris-dev.yml down
```
If you need to stop the containers, use:

or
```bash
docker-compose -f docker-compose/pyris-dev.yml down
```

```bash
docker-compose -f docker-compose/pyris-production.yml down
```
or

5. **Logs and Debugging**
```bash
docker-compose -f docker-compose/pyris-production.yml down
```

- View the logs for a specific service, e.g., Pyris:
You can also customize the configuration for Weaviate, Pyris, and Nginx by editing their respective configuration files. However, the default setup should work fine for most users.

```bash
docker-compose -f docker-compose/pyris-dev.yml logs pyris-app
```
For development, access the API documentation at `http://localhost:8000/docs`. For production, access the application at your domain (e.g., `https://<your-domain>`).

- For production, ensure that Nginx and Weaviate services are running smoothly and check their respective logs if needed.
If you need to view logs or debug, you can check the logs of specific services using:

---
```bash
docker-compose -f docker-compose/pyris-dev.yml logs pyris-app
```

This setup should help you run the Pyris application in both development and production environments with Docker. Ensure you modify the configuration files as per your specific requirements before deploying.
This guide should help you quickly get Pyris running with Docker. The first step—building and running the containers—is all you need to get started!

0 comments on commit 5efb198

Please sign in to comment.