From 8faabf1bfe7c2d965c6e659a6a96d5cfcbe823e0 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 21:53:32 +0000 Subject: [PATCH 01/15] add .ssl to gitignore, storing self signed certs in nginx directory to allow close pathing for docker build --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4ea1197..09da91f 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,5 @@ ENV/ # OS generated files .DS_Store + +.ssl From 09677ec7c559c7aa91a6e337b4e3c8b0b655d563 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 22:19:38 +0000 Subject: [PATCH 02/15] Switch to using official nginx docker image. Reorganize nginx configuration, open port 443 in docker compose --- dockereve-master/docker-compose.yml | 3 + dockereve-master/nginx/Dockerfile | 7 +- dockereve-master/nginx/nginx.conf | 105 ++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 dockereve-master/nginx/nginx.conf diff --git a/dockereve-master/docker-compose.yml b/dockereve-master/docker-compose.yml index f07d0c2..0fcc8f9 100644 --- a/dockereve-master/docker-compose.yml +++ b/dockereve-master/docker-compose.yml @@ -3,8 +3,11 @@ nginx: build: ./nginx/ ports: - 80:80 + - 443:443 volumes: - /www/static + - ./uwsgi_params.par:/etc/nginx/uwsgi_params.par:ro + - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro volumes_from: - eve links: diff --git a/dockereve-master/nginx/Dockerfile b/dockereve-master/nginx/Dockerfile index 2a99696..b2c9f31 100644 --- a/dockereve-master/nginx/Dockerfile +++ b/dockereve-master/nginx/Dockerfile @@ -1,3 +1,6 @@ -FROM tutum/nginx -RUN rm /etc/nginx/sites-enabled/default +FROM nginx +COPY .ssl/mriqcep.crt /etc/ssl/certs/mriqcep-selfsigned.crt +COPY .ssl/mriqcep.key /etc/ssl/private/mriqcep-selfsigned.key +#COPY .ssl/mriqcep_pass /etc/ssl/mriqcep_pass +#RUN rm /etc/nginx/sites-enabled/default ADD sites-enabled/ /etc/nginx/sites-enabled diff --git a/dockereve-master/nginx/nginx.conf b/dockereve-master/nginx/nginx.conf new file mode 100644 index 0000000..381cc03 --- /dev/null +++ b/dockereve-master/nginx/nginx.conf @@ -0,0 +1,105 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + +http { + server { + listen 80; + listen [::]:80 ; + server_name 34.224.227.208; + + location = /docs/api { + proxy_pass http://eve:5000/docs/api; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /api { + proxy_pass http://eve:5000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location / { + proxy_pass http://swagger_ui:8080/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + #return 301 https://$host$request_uri; + } + + + server { + + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name 34.224.227.208; + + # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate + # ssl_password_file /etc/ssl/.mriqcep_pass; + ssl_certificate /etc/ssl/certs/mriqcep-selfsigned.crt; + ssl_certificate_key /etc/ssl/private/mriqcep-selfsigned.key; + ssl_session_timeout 1d; + ssl_session_cache shared:SSL:10m; + ssl_session_tickets off; + + + # modern configuration. tweak to your needs. + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AES:RSA+3DES:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!ADH:!AECDH:!MD5:!DSS:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA"; + ssl_prefer_server_ciphers on; + + # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always; + add_header X-Frame-Options DENY always; + add_header X-Content-Type-Options nosniff always; + + # OCSP Stapling --- + # fetch OCSP records from URL in ssl_certificate and cache them + ssl_stapling on; + ssl_stapling_verify on; + + ## verify chain of trust of OCSP response using Root CA and Intermediate certs + #ssl_trusted_certificate /etc/ssl/certs/ssl_trusted_cert.crt; + + #resolver ; + resolver_timeout 5s; + + charset utf-8; + + # max upload size + client_max_body_size 75M; # adjust to taste + + + location = /docs/api { + proxy_pass http://eve:5000/docs/api; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /api { + proxy_pass http://eve:5000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location / { + proxy_pass http://swagger_ui:8080/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } +} From 3874910f6f1da05883490e627857d831467f0468 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 22:20:47 +0000 Subject: [PATCH 03/15] add hack to swagger dockerfile that forces scheme to be https --- dockereve-master/eve-app/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/dockereve-master/eve-app/Dockerfile b/dockereve-master/eve-app/Dockerfile index ca342a6..ba6c90a 100644 --- a/dockereve-master/eve-app/Dockerfile +++ b/dockereve-master/eve-app/Dockerfile @@ -6,6 +6,7 @@ ADD . /usr/src/app RUN pip3 install -r requirements.txt RUN pip3 install pytest +RUN sed -i 's/\[scheme\]/\["https"\]/' /usr/local/lib/python3.4/site-packages/eve_swagger/objects.py #EXPOSE 5000 #CMD ["python3", "server.py"] From 609923409780b5481a7abe01644fbc8746475d35 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 22:22:16 +0000 Subject: [PATCH 04/15] set domains in eve and swagger settings --- dockereve-master/eve-app/app.py | 2 ++ dockereve-master/eve-app/settings.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dockereve-master/eve-app/app.py b/dockereve-master/eve-app/app.py index 81c4f22..ff66a10 100644 --- a/dockereve-master/eve-app/app.py +++ b/dockereve-master/eve-app/app.py @@ -24,5 +24,7 @@ def check_auth(self, token, allowed_roles, resource, method): 'description': 'MRI Quality Control Metrics Repository', } +app.config['SWAGGER_HOST'] = 'mriqc.nimh.nih.gov' + if __name__ == '__main__': app.run(host='0.0.0.0') diff --git a/dockereve-master/eve-app/settings.py b/dockereve-master/eve-app/settings.py index 8664c56..c94db21 100644 --- a/dockereve-master/eve-app/settings.py +++ b/dockereve-master/eve-app/settings.py @@ -559,7 +559,8 @@ 'PUBLIC_ITEM_METHODS': ['GET'], 'RESOURCE_METHODS': ['GET', 'POST'], 'ITEM_METHODS': ['GET'], - 'X_DOMAINS': '*', + 'X_DOMAINS': ['http://localhost:8080', 'https://mriqc.nimh.nih.gov', 'http://mriqc.nimh.nih.gov', '*'], + 'X_HEADERS': ['Content-Type', 'If-Match'], 'DOMAIN': { 'bold': { 'item_title': 'bold', From 9fd02313cf74cd4b222e8167928596aece6c18c7 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 16:02:41 -0700 Subject: [PATCH 05/15] remove .env from project, should add back in a .env_example maybe --- dockereve-master/.env | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 dockereve-master/.env diff --git a/dockereve-master/.env b/dockereve-master/.env deleted file mode 100644 index 2bd1ee8..0000000 --- a/dockereve-master/.env +++ /dev/null @@ -1,5 +0,0 @@ -MONGODB_HOST=mongodb -MONGODB_PORT=27017 - -API_TOKEN=afaketoken -API_URL=http://localhost/docs/api From 8a6bf6fd3e672df2802286c72c81b253fbee38c3 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 16:24:09 -0700 Subject: [PATCH 06/15] remove old sites enabled directory, remove ssl parts of nginx conf to allow circle to work without needing to generate certs --- dockereve-master/nginx/nginx.conf | 65 ------------------- .../nginx/sites-enabled/eve_project | 27 -------- 2 files changed, 92 deletions(-) delete mode 100644 dockereve-master/nginx/sites-enabled/eve_project diff --git a/dockereve-master/nginx/nginx.conf b/dockereve-master/nginx/nginx.conf index 381cc03..389bb5d 100644 --- a/dockereve-master/nginx/nginx.conf +++ b/dockereve-master/nginx/nginx.conf @@ -37,69 +37,4 @@ http { } #return 301 https://$host$request_uri; } - - - server { - - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name 34.224.227.208; - - # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate - # ssl_password_file /etc/ssl/.mriqcep_pass; - ssl_certificate /etc/ssl/certs/mriqcep-selfsigned.crt; - ssl_certificate_key /etc/ssl/private/mriqcep-selfsigned.key; - ssl_session_timeout 1d; - ssl_session_cache shared:SSL:10m; - ssl_session_tickets off; - - - # modern configuration. tweak to your needs. - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AES:RSA+3DES:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!ADH:!AECDH:!MD5:!DSS:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA"; - ssl_prefer_server_ciphers on; - - # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) - add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always; - add_header X-Frame-Options DENY always; - add_header X-Content-Type-Options nosniff always; - - # OCSP Stapling --- - # fetch OCSP records from URL in ssl_certificate and cache them - ssl_stapling on; - ssl_stapling_verify on; - - ## verify chain of trust of OCSP response using Root CA and Intermediate certs - #ssl_trusted_certificate /etc/ssl/certs/ssl_trusted_cert.crt; - - #resolver ; - resolver_timeout 5s; - - charset utf-8; - - # max upload size - client_max_body_size 75M; # adjust to taste - - - location = /docs/api { - proxy_pass http://eve:5000/docs/api; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location /api { - proxy_pass http://eve:5000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location / { - proxy_pass http://swagger_ui:8080/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - } } diff --git a/dockereve-master/nginx/sites-enabled/eve_project b/dockereve-master/nginx/sites-enabled/eve_project deleted file mode 100644 index 258e4d2..0000000 --- a/dockereve-master/nginx/sites-enabled/eve_project +++ /dev/null @@ -1,27 +0,0 @@ -server { - - listen 80; - server_name _; - charset utf-8; - - location = /docs/api { - proxy_pass http://eve:5000/docs/api; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location = / { - proxy_pass http://swagger_ui:8080/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location / { - proxy_pass http://eve:5000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } -} From 7450116554f546ae515231a4ed99f225c1d00810 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:11:32 -0700 Subject: [PATCH 07/15] example env --- dockereve-master/env_example | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 dockereve-master/env_example diff --git a/dockereve-master/env_example b/dockereve-master/env_example new file mode 100644 index 0000000..78ac731 --- /dev/null +++ b/dockereve-master/env_example @@ -0,0 +1,5 @@ +MONGODB_HOST=mongodb +MONGODB_PORT=27017 + +API_TOKEN= +API_URL=http://localhost/docs/api From d808ea93c315a423ebaf9ebf8d7e44bcb39c3be7 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:12:36 -0700 Subject: [PATCH 08/15] have circle use example env file --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 2d16d05..bf37b7a 100644 --- a/circle.yml +++ b/circle.yml @@ -15,6 +15,7 @@ machine: test: pre: + - mv dockereve-master/env_example dockereve-master/.env - docker-compose -f dockereve-master/docker-compose.yml build override: - docker-compose -f dockereve-master/docker-compose.yml up -d From 7c5536bac8cef479cdeadffe5936e3a43581d310 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:19:07 -0700 Subject: [PATCH 09/15] put dummy cert files in circle environment to allow docker build on nginx to pass --- circle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/circle.yml b/circle.yml index bf37b7a..0809036 100644 --- a/circle.yml +++ b/circle.yml @@ -16,6 +16,9 @@ machine: test: pre: - mv dockereve-master/env_example dockereve-master/.env + - mkdir dockereve-master/nginx/.ssl + - touch dockereve-master/nginx/.ssl/mriqcep-selfsigned.crt + - touch dockereve-master/nginx/.ssl/mriqcep-selfsigned.key - docker-compose -f dockereve-master/docker-compose.yml build override: - docker-compose -f dockereve-master/docker-compose.yml up -d From 3d9225efffdb844d9981679fd499040699a37b1e Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:24:47 -0700 Subject: [PATCH 10/15] use correct file names for certs in circle.yml --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 0809036..455cbdd 100644 --- a/circle.yml +++ b/circle.yml @@ -17,8 +17,8 @@ test: pre: - mv dockereve-master/env_example dockereve-master/.env - mkdir dockereve-master/nginx/.ssl - - touch dockereve-master/nginx/.ssl/mriqcep-selfsigned.crt - - touch dockereve-master/nginx/.ssl/mriqcep-selfsigned.key + - touch dockereve-master/nginx/.ssl/mriqcep.crt + - touch dockereve-master/nginx/.ssl/mriqcep.key - docker-compose -f dockereve-master/docker-compose.yml build override: - docker-compose -f dockereve-master/docker-compose.yml up -d From b6f6f4729dcf5a6307b4c5ccf6c4d152aeb67bca Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:28:16 -0700 Subject: [PATCH 11/15] remove sites-enabled from nginx dockerfile --- dockereve-master/nginx/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/dockereve-master/nginx/Dockerfile b/dockereve-master/nginx/Dockerfile index b2c9f31..d90d3ee 100644 --- a/dockereve-master/nginx/Dockerfile +++ b/dockereve-master/nginx/Dockerfile @@ -1,6 +1,3 @@ FROM nginx COPY .ssl/mriqcep.crt /etc/ssl/certs/mriqcep-selfsigned.crt COPY .ssl/mriqcep.key /etc/ssl/private/mriqcep-selfsigned.key -#COPY .ssl/mriqcep_pass /etc/ssl/mriqcep_pass -#RUN rm /etc/nginx/sites-enabled/default -ADD sites-enabled/ /etc/nginx/sites-enabled From 084f9b71095c3c7aa0dc08b00bf975fe2d9109b4 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Mon, 5 Jun 2017 17:49:35 -0700 Subject: [PATCH 12/15] do config file managment for nginx in compose instead of dockerfile --- dockereve-master/docker-compose.yml | 3 ++- dockereve-master/nginx/Dockerfile | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 dockereve-master/nginx/Dockerfile diff --git a/dockereve-master/docker-compose.yml b/dockereve-master/docker-compose.yml index 0fcc8f9..8d17dda 100644 --- a/dockereve-master/docker-compose.yml +++ b/dockereve-master/docker-compose.yml @@ -1,6 +1,6 @@ nginx: + image: nginx restart: always - build: ./nginx/ ports: - 80:80 - 443:443 @@ -8,6 +8,7 @@ nginx: - /www/static - ./uwsgi_params.par:/etc/nginx/uwsgi_params.par:ro - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - ./nginx/.ssl:/etc/ssl/certs/ volumes_from: - eve links: diff --git a/dockereve-master/nginx/Dockerfile b/dockereve-master/nginx/Dockerfile deleted file mode 100644 index d90d3ee..0000000 --- a/dockereve-master/nginx/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx -COPY .ssl/mriqcep.crt /etc/ssl/certs/mriqcep-selfsigned.crt -COPY .ssl/mriqcep.key /etc/ssl/private/mriqcep-selfsigned.key From cb450a0987b6a89d035fed783a00b0f07a76d797 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Tue, 6 Jun 2017 13:31:44 -0700 Subject: [PATCH 13/15] for ease of startup for new development switch back to a ready to go .env file. --- circle.yml | 1 - dockereve-master/{env_example => .env} | 0 dockereve-master/eve-app/app.py | 3 +-- dockereve-master/eve-app/settings.py | 3 +-- 4 files changed, 2 insertions(+), 5 deletions(-) rename dockereve-master/{env_example => .env} (100%) diff --git a/circle.yml b/circle.yml index 455cbdd..5fae6a1 100644 --- a/circle.yml +++ b/circle.yml @@ -15,7 +15,6 @@ machine: test: pre: - - mv dockereve-master/env_example dockereve-master/.env - mkdir dockereve-master/nginx/.ssl - touch dockereve-master/nginx/.ssl/mriqcep.crt - touch dockereve-master/nginx/.ssl/mriqcep.key diff --git a/dockereve-master/env_example b/dockereve-master/.env similarity index 100% rename from dockereve-master/env_example rename to dockereve-master/.env diff --git a/dockereve-master/eve-app/app.py b/dockereve-master/eve-app/app.py index 821fc1c..032283f 100644 --- a/dockereve-master/eve-app/app.py +++ b/dockereve-master/eve-app/app.py @@ -3,6 +3,7 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: import os +import socket from eve import Eve from eve.auth import TokenAuth @@ -26,7 +27,5 @@ def check_auth(self, token, allowed_roles, resource, method): 'description': 'MRI Quality Control Metrics Repository', } -app.config['SWAGGER_HOST'] = 'mriqc.nimh.nih.gov' - if __name__ == '__main__': app.run(host='0.0.0.0') diff --git a/dockereve-master/eve-app/settings.py b/dockereve-master/eve-app/settings.py index 952cc8d..463e053 100644 --- a/dockereve-master/eve-app/settings.py +++ b/dockereve-master/eve-app/settings.py @@ -560,8 +560,7 @@ 'PUBLIC_ITEM_METHODS': ['GET'], 'RESOURCE_METHODS': ['GET', 'POST'], 'ITEM_METHODS': ['GET'], - 'X_DOMAINS': ['http://localhost:8080', 'https://mriqc.nimh.nih.gov', 'http://mriqc.nimh.nih.gov', '*'], - 'X_HEADERS': ['Content-Type', 'If-Match'], + 'X_DOMAINS': '*', 'DOMAIN': { 'bold': { 'item_title': 'bold', From 7dcbebc8ec15df94f3e8b1b616739ad3838708e4 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Tue, 6 Jun 2017 13:46:02 -0700 Subject: [PATCH 14/15] update README.md --- dockereve-master/README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dockereve-master/README.md b/dockereve-master/README.md index 479f408..197223c 100644 --- a/dockereve-master/README.md +++ b/dockereve-master/README.md @@ -5,19 +5,23 @@ Built on: * [Docker](https://www.docker.com/) ## Run +Example of commands to run locally to start: ```sh $ docker-compose build -$ docker-compose up -$ curl -i -H "Content-Type: application/json" http://192.168.99.100:80/T1w +$ docker-compose up -d +$ curl -i -H "Content-Type: application/json" http://localhost/api/v1/T1w ``` Swagger API documentation available at `http://localhost/docs`. ## Environment variables in Docker -To properly run the file dockereve-master/.env needs to be created and populated with the following values: +To properly run the file dockereve-master/.env needs to be populated the following are the default values: ``` -MONGODB_HOST=full url to mongodb host -MONGODB_PORT=port that mongo is running on -API_TOKEN=random string that is used for auth -API_URL=full url to swagger docs in the api +MONGODB_HOST=mongodb +MONGODB_PORT=27017 + +API_TOKEN= +API_URL=http://localhost/docs/api ``` + +If docker is running natively these values should work, otherwise API_URL may need to be updated from localhost accordingly. From 911d14ad710458c60ea6e4ae2343b0f5db0d43ba Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Tue, 6 Jun 2017 13:52:54 -0700 Subject: [PATCH 15/15] move populated readme to highest directory level --- README.md | 29 ++++++++++++++++++++++++++++- dockereve-master/README.md | 27 --------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 dockereve-master/README.md diff --git a/README.md b/README.md index 2caf1e2..372ff69 100644 --- a/README.md +++ b/README.md @@ -1 +1,28 @@ -# mriqcwebapi \ No newline at end of file +Built on: +* [Python Eve](http://python-eve.org/) +* [Python Gunicorn](http://gunicorn.org/) +* [Nginx](https://nginx.org/) +* [Docker](https://www.docker.com/) + +## Run +Example of commands to run locally to start: +```sh +$ cd dockereve-master/ +$ docker-compose build +$ docker-compose up -d +$ curl -i -H "Content-Type: application/json" http://localhost/api/v1/T1w +``` + +Swagger API documentation available at `http://localhost/docs`. + +## Environment variables in Docker +To properly run the file dockereve-master/.env needs to be populated the following are the default values: +``` +MONGODB_HOST=mongodb +MONGODB_PORT=27017 + +API_TOKEN= +API_URL=http://localhost/docs/api +``` + +If docker is running natively these values should work, otherwise API_URL may need to be updated from localhost accordingly. diff --git a/dockereve-master/README.md b/dockereve-master/README.md deleted file mode 100644 index 197223c..0000000 --- a/dockereve-master/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Built on: -* [Python Eve](http://python-eve.org/) -* [Python Gunicorn](http://gunicorn.org/) -* [Nginx](https://nginx.org/) -* [Docker](https://www.docker.com/) - -## Run -Example of commands to run locally to start: -```sh -$ docker-compose build -$ docker-compose up -d -$ curl -i -H "Content-Type: application/json" http://localhost/api/v1/T1w -``` - -Swagger API documentation available at `http://localhost/docs`. - -## Environment variables in Docker -To properly run the file dockereve-master/.env needs to be populated the following are the default values: -``` -MONGODB_HOST=mongodb -MONGODB_PORT=27017 - -API_TOKEN= -API_URL=http://localhost/docs/api -``` - -If docker is running natively these values should work, otherwise API_URL may need to be updated from localhost accordingly.