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

Commit

Permalink
Adding API key environment variable and better logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
grugnog committed Jun 30, 2015
1 parent 7008137 commit d2e5a4e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions DEVOPS_MANUAL.md
Expand Up @@ -20,6 +20,7 @@ The development environment is fully self-contained, and is based on Docker and
### Requirements
1. [Docker](https://www.docker.com/)
1. [Docker Compose](https://docs.docker.com/compose/)
1. An [FDA API Key](https://open.fda.gov/api/reference/#your-api-key)

### Instructions

Expand All @@ -31,6 +32,11 @@ cd nebula

If you are using boot2docker, make sure it is started up and it's shell environment variable are available before continuing.

Export your FDA API Key, adding it to the end of this command:
```
export FDA_API_KEY=
```

To start docker containers, initiate database schemas and import:
```
./bin/build
Expand Down
2 changes: 2 additions & 0 deletions backend/configuration/php-fpm.conf
@@ -1,6 +1,7 @@
[global]
error_log = /proc/self/fd/2
daemonize = no
log_level = warning

[www]
# BOOT2DOCKER LIMITATIONS
Expand All @@ -12,6 +13,7 @@ php_admin_value[date.timezone] = 'America/New_York'
php_admin_flag[short_open_tag] = off

access.log = /proc/self/fd/2
catch_workers_output = yes
listen = [::]:9000
pm = dynamic
pm.max_children = 100
Expand Down
2 changes: 2 additions & 0 deletions backend/docker-compose.yml
Expand Up @@ -5,6 +5,8 @@ web:
volumes:
- .:/var/www/nebula
- ./configuration/nginx.conf:/etc/nginx/conf.d/default.conf
environment:
- FDA_API_KEY
links:
- php
php:
Expand Down
2 changes: 1 addition & 1 deletion backend/web/index.php
Expand Up @@ -42,7 +42,7 @@ function queryFDA($search) {
$response = $client->get('https://api.fda.gov/drug/event.json', [
'http_errors' => FALSE,
'query' => [
'api_key' => 'rv4OOon6fPJOHBbFHClUOs3BRGSbAEUdg3ACp2pu',
'api_key' => $_ENV['FDA_API_KEY'],
'search' => $search,
'count' => 'patient.reaction.reactionmeddrapt.exact'],
]);
Expand Down

0 comments on commit d2e5a4e

Please sign in to comment.