-
Start dependent services: RabbitMQ and RedPanda
./docker/dependencies/up.sh
-
Setup RabbitMQ configuration (queues, etc). You may need to wait 30 seconds from the previous command to run this one as it requires Rabbitmq to have started completely:
python setup_dev_rabbit.py
-
Load Redpanda schemas:
./schemas/push.sh http://localhost:8081
-
Build docker image
docker build . -t tol-lab-share:develop
-
Create .env file with contents
SETTINGS_MODULE=tol_lab_share.config.defaults LOCALHOST=host.docker.internal REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt REDPANDA_URL=http://host.docker.internal:8081 RABBITMQ_HOST=host.docker.internal RABBITMQ_PORT=5672 RABBITMQ_USERNAME=admin RABBITMQ_PASSWORD=development
-
Start interactive bash in docker container
docker run -ti -v $(pwd):/code -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro --env-file=.env --entrypoint bash tol-lab-share:develop
-
Start the consumer service (inside the previous bash)
pipenv run python main.py
After this you should have:
- Consumer (python main.py) running connected to Rabbitmq queue
- Rabbitmq service running in http://localhost:8080/ with user/password: admin/development
- Redpanda API service running in local in http://localhost:8081/
If you want to perform any changes in code, you can kill the consumer with Control-C, modify the code in local and then restart the consumer again using the same command