In hybrid mode, you will run vets-api natively, but run Postgres and Redis in Docker. By doing so you avoid any challenges of installing these two software packages and keeping them upgraded to the appropriate version.
-
Install Docker as referenced in the Docker setup instructions.
-
Follow the Native setup instructions, but skip any steps related to installing Postgres, Postgis, or Redis. You will need to install the other dependencies such as pdftk and clamav.
-
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.