Welcome to HospitalRun Deployment Documentation. You can log issues, comments or contributions on the public repository here.
Here are some configuration scripts that have been used in designing this application. It is important you know exactly what they do, so you can manipulate your configuration or scale them as you desire.
- docker-compose.yml
- config-example.js
- Dockerfile
- utils/elasticsearch.sh
- nginx/conf/certbot-auto
- nginx/conf/.tmpl, nginx/conf/.conf
- nginx/conf/entrypoint.sh
- nginx/Dockerfile
- logstash/pipeline/logstash.conf
- logstash/Dockerfile
- data
- conf/initcouch.sh
- conf/entrypoint.sh
Assumptions: You should have git
, docker
and docker-compose
running on your machine before the steps above can work. The instructions also assume you will be running this on a Linux machine, preferably Ubuntu LTS >=14.04
Follow these five easy steps to get HospitalRun up and running
- Clone the repository
git clone [email protected]:HospitalRun/hospitalrun-server.git
. - Run
cd hospitalrun-server
. This should take you into thehospitalrun-server
root folder - From this location, edit the
docker-compose.yml
file.
- To use automatic SSL cert generation, edit the
DOMAIN_NAME
argument and replacewww.example.com
as shown in the image below with the publicly accessible domain name that HospitalRun will run on. - To instead use your own SSL cert, change the
SSL_TYPE
argument toself
and place your certificate files atdata/nginx/cert/ssl.crt
anddata/nginx/cert/ssl.key
. You will need to create adata/nginx/cert
path from the root folder if you haven't run the server yet.
- Save the file and run
docker-compose up --build
. You should wait for some ten minutes or less for your environment to be up and running. Deployment speed will vary based on your internet connection speed and the quality of your infrastructure - Go to http://localhost/ in a browser and login with username
hradmin
and passwordtest
Run docker-compose ps
. Note the State
column of the command's output.
or something similar: the port 80
is in use already. Either find which application uses that and free the port
or edit the docker-compose.yml
and change the "80:80"
into "<another port which is free>:80"
.
Usually due to SSL configuration being incorrect. Either 'auto' configuration and the cert generation is failing, or 'self' and the cert files are not placed correctly. Viewing the container's log output should provide more info.
This folder contains all the data needed to be available should the containers be shutdown, or restarted for any reason. It should contain after startup, the following:
- Nginx folder, and Let's Encrypt certificates
- CouchDB Data
- Elasticsearch Data
If you delete this folder, you WILL lose all your data and installed SSL certificate
List of Containers:
- Nginx - WebServer
- HospitalRun - Node.JS App Server
- Logstash - Log Streaming Application
- Elasticsearch - For Search
- CouchDB - NoSQL Data Store
Nginx
The Nginx container contains configuration files for routing requests to the app server. It definitely can handle more requests in a production environment and is suited for such. This container is also designed to automatically install letsencrypt certificates for secure HTTP. It receives requests from the internet and routes it to port 3000 on the hospitalrun container. It listens for requests on ports 80 and 443
HospitalRun
This container runs the application and listens for requests on port 3000. At startup, it has entry point scripts that initialize couchdb using the conf/initcouch.sh script and another that at utils/elasticsearch.sh that initializes elasticsearch mappings. The container also runs the npm start command on successful deployment
Logstash
This container gets relevant data from the couchdb container using the instruction in logstash/conf/logstash.conf file and passes over relevant data to the elasticsearch container
Elasticsearch
This container receives data passed to it from logstash, making it possible to have lightening fast search results from the HospitalRun application
CouchDB
This container saves user authentication and all other data within the HospitalRun application.