okfn-brasil / jarbas

🎩 API for information and suspicions about reimbursements by Brazilian congresspeople
https://jarbas.serenata.ai/
296 stars 61 forks source link

Minor fixes to deploy with Docker to jarbas.serenata.ai #305

Closed cuducos closed 6 years ago

cuducos commented 6 years ago

What is the purpose of this Pull Request?

Testing the new production architecture with Docker, using the new domain, I made some minor changes to make it happen.

What was done to achieve this purpose?

  1. Add network to all containers accessed by or accessing the django container
  2. Changes references to jarbas.serenatadeamor.org to jarbas.serenata.ai
  3. Removed some files used to deploy without Docker (as in #191) and renamed a few of the remaining ones (no nginx and nginx.docker anymore, just nginx.conf)
  4. Better document how to user VIRTUAL_HOST_WEB envvar

How to test if it really works?

Access jarbas.serenata.ai and check if it's working (it uses this branch, not master).

Who can help reviewing it?

@anaschwendler

anaschwendler commented 6 years ago

I think that a good way to test it, is by running the tests.

What I did:

  1. Checked out to this branch:

    $ git fetch origin
    $ git checkout -b cuducos-production-fixes origin/cuducos-production-fixes
    $ git merge master
  2. Run the tests:

    $ docker-compose run --rm django python manage.py test --parallel

    The result:

    
    ➜  jarbas git:(cuducos-production-fixes) ✗ docker-compose run --rm django python manage.py test --parallel
    Starting jarbas_postgres_1 ... 
    Starting jarbas_queue_1 ... 
    Starting jarbas_postgres_1 ... done
    Starting jarbas_tasks_1 ... done
    Creating test database for alias 'default'...
    Cloning test database for alias 'default'...
    Cloning test database for alias 'default'...
    System check identified no issues (0 silenced).
    ...........................................................................................................................................................................
    ----------------------------------------------------------------------
    Ran 171 tests in 5.180s

OK Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'...