diff --git a/README.md b/README.md index f4844b94..a9cfdd1c 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,12 @@ To view staging logs go to https://grafana-nomad.lib.princeton.edu and log in wi Build Docker Image: `docker build . -t dpul-collections` +Set up database: `mix setup` + The SECRET_KEY_BASE below is just a filler one for the purpose of testing locally. -Run Docker Image: `docker run -t -p 4000:4000 -e DATABASE_URL='ecto://postgres:@host.docker.internal:5434/database' -e SECRET_KEY_BASE='B8rwzeX3DFLveiJ4cP28lRGc0PWdEr8ZF/hDoPRucw95Nzf2IPnu7lhEB+Yldx6Z' dpul-collections` +Run Docker Image: `docker run -t -p 4000:4000 -e INDEXER=true -e INDEX_CACHE_COLLECTIONS='cache_version:1,write_collection:dpulc' -e PHX_HOST=localhost -e SOLR_CONFIG_SET='dpul-collections' -e SOLR_USERNAME='solr' -e SOLR_PASSWORD='SolrRocks' -e SOLR_READ_COLLECTION='dpulc' -e SOLR_BASE_URL='http://host.docker.internal:8985' -e RELEASE_IP=127.0.0.1 -e FIGGY_DATABASE_URL='ecto://postgres:postgres@host.docker.internal:5435/postgres' -e DATABASE_URL='ecto://postgres:@host.docker.internal:5434/dpul_collections_dev' -e SECRET_KEY_BASE='B8rwzeX3DFLveiJ4cP28lRGc0PWdEr8ZF/hDoPRucw95Nzf2IPnu7lhEB+Yldx6Z' dpul-collections` + +Commit Solr: `curl http://solr:SolrRocks@localhost:8985/solr/dpulc/update?commit=true` + +Available at http://localhost:4000 diff --git a/config/runtime.exs b/config/runtime.exs index 7319fef2..90a56f42 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -77,8 +77,8 @@ if config_env() == :prod do base_url: solr_base_url, read_collection: solr_read_collection, config_set: solr_config_set, - username: "", - password: "" + username: System.get_env("SOLR_USERNAME") || "", + password: System.get_env("SOLR_PASSWORD") || "" } index_cache_collections = @@ -116,7 +116,7 @@ if config_env() == :prod do host = System.get_env("PHX_HOST") || "example.com" port = String.to_integer(System.get_env("PORT") || "4000") - check_origin = ["https://#{host}"] + check_origin = true config :dpul_collections, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")