-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds and documents "hybrid mode" vets-api setup. (#6011)
Adds instructions and a docker-compose file for running Postgres and Redis in docker but running vets-api natively.
- Loading branch information
1 parent
1724857
commit 9d0112f
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: '3.4' | ||
services: | ||
redis: | ||
image: redis:5.0-alpine | ||
ports: | ||
- "63790:6379" | ||
postgres: | ||
image: mdillon/postgis:11-alpine | ||
environment: | ||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-password}" | ||
POSTGRES_USER: "${POSTGRES_USER:-postgres}" | ||
volumes: | ||
- ./data:/var/lib/postgresql/data:cached | ||
ports: | ||
- "54320:5432" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Developer Setup | ||
|
||
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. | ||
|
||
|
||
|
||
## Base Setup | ||
|
||
1. Install Docker as referenced in the [Docker setup instructions](docker.md). | ||
|
||
1. Follow the [Native setup instructions](native.md), but skip any steps related to installing Postgres, Postgis, or Redis. You *will* need to install the other dependencies such as pdftk and clamav. | ||
|
||
1. 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.* | ||
|
||
## Running | ||
|
||
1. To start Postgres and Redis: `docker-compose -f docker-compose-deps.yml up` | ||
|
||
1. Start vets-api as per the [native running instructions](running_natively.md). |