In hybrid mode, you'll run vets-api natively, but run Postgres and Redis in Docker. By doing so, you avoid the challenges of installing these two software packages and having to keep them upgraded to the appropriate version.
Follow these steps, or alternatively use binstubs.
-
Install Docker as referenced in the Docker setup instructions.
-
Follow the Native setup instructions, but skip any steps related to installing Postgres, Postgis, Redis or ClamAV. You will need to install the other dependencies such as pdftk.
-
Configure vets-api to point to the Docker-ized dependencies. Add the following to
config/settings.local.yml
:
database_url: postgis://postgres:password@localhost:54320/vets_api_development?pool=4
test_database_url: postgis://postgres:password@localhost:54320/vets_api_test?pool=4
redis:
host: localhost
port: 63790
app_data:
url: redis://localhost:63790
sidekiq:
url: redis://localhost:63790
Note: If you have local instances of Postgres or Redis that were only for use by vets-api, you can stop them to save system resources.
- To start Postgres and Redis: run
docker-compose -f docker-compose-deps.yml up
in one terminal window. - In another terminal window, start
vets-api
as per the native running instructions.
- Run
bin/setup
first to create the needed database tables.
- Confirm the API is successfully running by seeing if you can visit the local Flipper page.
If you wish to mock ClamAV, please set the clamav mock setting to true in settings.local.yml. This will mock the clamav response in the virus_scan code.
clamav:
mock: true