Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.67 KB

SETUP_DOCKER.md

File metadata and controls

59 lines (42 loc) · 1.67 KB

Setting up a complete development environment from scratch

  1. Start dependent services: RabbitMQ and RedPanda

    ./docker/dependencies/up.sh
  2. 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
  3. Load Redpanda schemas:

    ./schemas/push.sh http://localhost:8081
  4. Build docker image

    docker build . -t tol-lab-share:develop
  5. 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
    
  6. 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
  7. Start the consumer service (inside the previous bash)

    pipenv run python main.py

After this you should have:

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