To run the entire app on docker, first build the user_service
and image_service
images.
docker-compose -f docker-compose.yml -f deployment/docker/docker-compose-imageservice.yml -f deployment/docker/docker-compose-userservice.yml build
The following command will get user_service
, image_service
and their dependent images started.
docker-compose -f docker-compose.yml -f deployment/docker/docker-compose-imageservice.yml -f deployment/docker/docker-compose-userservice.yml up
Apply migrations for the user_service
by running the following command.
docker exec user_service flask db upgrade
Apply migrations for the image_service
by running the following command.
docker exec image_service python manage.py migrate
Start the Celery workers in detached mode to handle asynchronous tasks.
docker exec -d image_service celery -A image_service worker -l INFO
-
Creating Users
curl -X POST http://localhost:5000/api/user -H "Content-Type: application/json" -d '{"username":"joe", "password":"joepassword"}'
-
Obtaining User JWT
curl -X POST http://localhost:5000/api/user -H "Content-Type: application/json" -d '{"username":"joe", "password":"joepassword"}' # example response {"access_token": <token string>}
user_service
docs: http://localhost:5000/swagger-ui/