Serving Text to Image Model Using FastAPI, RabbitMQ and Celery worker
- Clone repository
git clone https://github.com/ainize-team/TTI-FastAPI
cd TTI-FastAPI
-
Edit docker-compose.yml, rabbitmq.env and fastapi.env for your project.
-
Run containers
docker-compose up -d
- (Optional) config rabbimq user setting
docker exec tti-rabbitmq -it /bin/bash
cd scripts
./init_rabbitmq
- Clone repository
git clone https://github.com/ainize-team/TTI-FastAPI
cd TTI-FastAPI
- Build docker image
docker build -t tti-fastapi .
- 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
- install dev package.
poetry install
- install pre-commit.
pre-commit install