Commit 51c973c6 authored by Luís de Sousa's avatar Luís de Sousa
Browse files

Deployment notes in README.

parent f3ed19af
# WSM
World Soil Museum - REST API
#Copyright
Some content is protected and paid, therefore distibution is not allowe
# Copyright
(c) ISRIC - Worlds Soil Information
# Licence
Some content is protected and paid, therefore distibution is not allowed.
# Deployment
This API is to be deployed within a docker container. The code resides in the
host system, together with the monoliths images to be served. These images
must be acessible in a folder named `monoliths` at the folder root (same level
as this file). This code folder is then mapped into the container at startup.
The Dockerfile present in this project sets up the API with Gunicorn and nginx.
To build the container image change to the project folder and run:
`docker build -t ldesousa/wsm.rest .`
The resulting image is named `ldesousa/wsm.rest`. To run the image it is
necessary to map the source code folder and port 80 (where nginx listens):
`docker run -dit -v /var/www/wsm.rest:/var/www/wsm.rest --name wsm.rest -p 8081:80 ldesousa/wsm.rest`
Gunicorn can only be started after the source code folder has been mapped. To
do so attach to the running container (named `wsm.rest`):
`docker attach wsm.rest`
And then run the startup script:
`sh /var/www/wsm.rest/configs/startup.sh`
Finally, detach orderly from the running container with the escape sequence:
`Ctrl+P Ctrl+Q`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment