Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

More flexibility for installations #328

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ A simple Rails app for evaluating FHIR.
- Start the server: `docker-compose up`
- Navigate to `http://localhost:3000`


#### Docker ENV Variables

To configure the image in docker the following env variables can be used:

- `MONGODB_HOST` : Host
- `MONGODB_USER` : User
- `MONGODB_PASSWORD` : Password
- `CRUCIBLE_SERVER` : Hostname of the Crucible server (for the task runner)

### OSX Installation ###

#### Dependencies
Expand Down
4 changes: 3 additions & 1 deletion bin/docker-start-tasks.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

while ! nc -w 10 -z web $1;
SERVER=${CRUCIBLE_SERVER:-web}

while ! nc -w 10 -z $SERVER $1;
do
echo Task runner waiting for crucible web app to load on port $1;
sleep 10;
Expand Down
23 changes: 23 additions & 0 deletions config/mongoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ development:
database: crucible_development
hosts:
- <%= ENV['MONGODB_HOST'] || "localhost:27017" %>


<% if ENV['MONGODB_USER'] != nil %>
user: <%= ENV['MONGODB_USER'] %>
<% end %>
<% if ENV['MONGODB_PASSWORD'] != nil %>
password: <%= ENV['MONGODB_PASSWORD'] %>
<% end %>

test:
sessions:
default:
Expand All @@ -16,9 +25,23 @@ test:
# low amounts for fast failures.
max_retries: 1
retry_interval: 0
<% if ENV['MONGODB_USER'] != nil %>
user: <%= ENV['MONGODB_USER'] %>
<% end %>
<% if ENV['MONGODB_PASSWORD'] != nil %>
password: <%= ENV['MONGODB_PASSWORD'] %>
<% end %>

production:
sessions:
default:
database: crucible_production
hosts:
- <%= ENV['MONGODB_HOST'] || "localhost:27017" %>

<% if ENV['MONGODB_USER'] != nil %>
user: <%= ENV['MONGODB_USER'] %>
<% end %>
<% if ENV['MONGODB_PASSWORD'] != nil %>
password: <%= ENV['MONGODB_PASSWORD'] %>
<% end %>