From 5efb1986ca9c81ab9f8385e1281cf522d460e0eb Mon Sep 17 00:00:00 2001 From: Yassine Souissi Date: Tue, 3 Sep 2024 20:23:49 +0200 Subject: [PATCH] Make the docker part more understandable and beginner friendly --- README.MD | 103 ++++++++++++++++++++++-------------------------------- 1 file changed, 42 insertions(+), 61 deletions(-) diff --git a/README.MD b/README.MD index 7ad4f29..4d18e6b 100644 --- a/README.MD +++ b/README.MD @@ -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. @@ -59,86 +59,67 @@ Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtu APPLICATION_YML_PATH= LLM_CONFIG_PATH= 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://`. + 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://`). + 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://`. - 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://`). - - 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. \ No newline at end of file +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! \ No newline at end of file