Skip to content

ainize-team/TTI-FastAPI

Repository files navigation

TTI-FastAPI

Serving Text to Image Model Using FastAPI, RabbitMQ and Celery worker

How to start

Using docker-compose(recommended)

  1. Clone repository
git clone https://github.com/ainize-team/TTI-FastAPI
cd TTI-FastAPI
  1. Edit docker-compose.yml, rabbitmq.env and fastapi.env for your project.

  2. Run containers

docker-compose up -d
  1. (Optional) config rabbimq user setting
docker exec tti-rabbitmq -it /bin/bash
cd scripts
./init_rabbitmq

Using docker

  1. Clone repository
git clone https://github.com/ainize-team/TTI-FastAPI
cd TTI-FastAPI
  1. Build docker image
docker build -t tti-fastapi .
  1. Create docker container
docker run -d --name tti-fastapi -p 8000:8000 \
    -e BROKER_URI=<broker_uri> \
    -e FIREBASE_DATABASE_URL=<firebase_realtime_database_url>  \
    -v <firebase_credential_dir_path>:/app/key tti-fastapi

Or, you can use the .env file to run as follows.

docker build -t tti-fastapi .
docker run -d --name tti-fastapi -p 8000:8000 \
    --env-file .env \
    -v <firebase_credential_dir_path>:/app/key tti-fastapi

For Developers

  1. install dev package.
poetry install
  1. install pre-commit.
pre-commit install