Skip to content

Latest commit

 

History

History
121 lines (86 loc) · 2.38 KB

DOCKER.md

File metadata and controls

121 lines (86 loc) · 2.38 KB

Docker Setup

This document provides instructions for building and running the srt-agent-api application using Docker.

Prerequisites

  • Docker installed on your machine.
  • Docker Compose installed.

Building the Docker Image

To build the Docker image, run the following command from the root of the repository:

docker build -t srt-agent-api .

Running the Docker Container

To run the Docker container, use the following command:

docker run -d -p 8000:8000 -e PERSONA='Default' -e PORT=8000 -e SERVER_NAME='0.0.0.0' --name srt-agent-api srt-agent-api

Using Docker Compose

A docker-compose.yml file is provided for easier management of multiple services. To use Docker Compose, run:

docker-compose up -d

Example docker-compose.yml

version: '3.8'

services:
  api:
    build: .
    container_name: srt-agent-api
    ports:
      - "8000:8000"
    environment:
      - PERSONA=Default
      - PORT=8000
      - SERVER_NAME=0.0.0.0

  search_module:
    build: .
    container_name: srt-agent-search
    ports:
      - "8001:8001"
    environment:
      - PERSONA=Search
      - PORT=8001
      - SERVER_NAME=0.0.0.0

  wiki_summary_module:
    build: .
    container_name: srt-agent-wiki-summary
    ports:
      - "8002:8002"
    environment:
      - PERSONA=WikiSummary
      - PORT=8002
      - SERVER_NAME=0.0.0.0

  wikipedia_query_module:
    build: .
    container_name: srt-agent-wikipedia-query
    ports:
      - "8003:8003"
    environment:
      - PERSONA=WikipediaQuery
      - PORT=8003
      - SERVER_NAME=0.0.0.0

Accessing the API

Once the containers are running, you can access the API endpoints as described in the README file.

Health Check

To check if the API service is running, use the health check endpoint:

curl -X GET "http://127.0.0.1:8000/"

Stopping the Containers

To stop the containers, use the following command:

docker-compose down

Logging

Logs can be accessed using the Docker logs command:

docker logs srt-agent-api

For Docker Compose, you can specify the service name:

docker-compose logs api

Contributing

Feel free to open issues or submit pull requests on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.