This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 644
[WIP] added some hints for the troubleshooting; fixed sleep instructions #119
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4dacf61
added some hints for the troubleshooting; fixed sleep instructions
stukalin 91955dd
Create npm-shrinkwrap.json
MatthewDorner 7213d1c
Update Dockerfile
MatthewDorner af515b7
Change to package-lock and node tag 10-slim, fix scripts.
MatthewDorner 2818c2d
Update DEPLOYMENT_GUIDE.md
MatthewDorner fe62f7c
Add files via upload
MatthewDorner 5e85d58
Add files via upload
MatthewDorner 65d2af7
Update DEPLOYMENT_GUIDE.md
MatthewDorner 70c64b4
Update DEPLOYMENT_GUIDE.md
MatthewDorner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,29 +21,17 @@ Welcome to HospitalRun Deployment Documentation. You can log issues, comments or | |
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 | ||
|
||
# **Deploying HospitalRun to a Production Environment** | ||
|
@@ -55,29 +43,32 @@ Here are some configuration scripts that have been used in designing this applic | |
Follow these five easy steps to get HospitalRun up and running | ||
|
||
1. Clone the repository `git clone [email protected]:HospitalRun/hospitalrun-server.git`. | ||
|
||
2. Run `cd hospitalrun-server`. This should take you into the `hospitalrun-server` root folder | ||
3. From this location, edit the `docker-compose.yml` file. | ||
To use automatic SSL cert generation, edit the `DOMAIN_NAME` argument and replace `www.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 to `self` and place your certificate files at `data/nginx/cert/ssl.crt` and `data/nginx/cert/ssl.key`. You will need to create a `data/nginx/cert` path from the root folder if you haven't run the server yet. | ||
![screenshot](screenshot.png) | ||
4. Save the file and run `docker-compose up --build -d`. 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 | ||
5. Go to [http://localhost/](http://localhost/) in a browser and login with username ```hradmin``` and password ```test``` | ||
|
||
3. From this location, edit the `docker-compose.yml` file. | ||
## Troubleshooting | ||
|
||
To use automatic SSL cert generation, edit the `DOMAIN_NAME` argument and replace `www.example.com` as shown in the image below with the publicly accessible domain name that HospitalRun will run on. | ||
### Check which containers run and which do not | ||
|
||
To instead use your own SSL cert, change the `SSL_TYPE` argument to `self` and place your certificate files at `data/nginx/cert/ssl.crt` and `data/nginx/cert/ssl.key`. You will need to create a `data/nginx/cert` path from the root folder if you haven't run the server yet. | ||
Run `docker-compose ps`. Note the `State` column of the command's output. | ||
|
||
4. Save the file and run `docker-compose up --build -d`. 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 | ||
### Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied' | ||
|
||
5. Go to [http://localhost/](http://localhost/) in a browser and login with username ```hradmin``` and password ```test``` | ||
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"`. | ||
|
||
![screenshot](screenshot.png) | ||
|
||
# **The Data Folder** | ||
|
||
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: | ||
|
||
1. Nginx folder, and Let's Encrypt certificates | ||
|
||
2. CouchDB Data | ||
|
||
3. Elasticsearch Data | ||
|
||
If you delete this folder, you WILL lose all your data and installed SSL certificate | ||
|
@@ -87,13 +78,9 @@ If you delete this folder, you WILL lose all your data and installed SSL certifi | |
**List of Containers:** | ||
|
||
1. Nginx - WebServer | ||
|
||
2. HospitalRun - Node.JS App Server | ||
|
||
3. Logstash - Log Streaming Application | ||
|
||
4. Elasticsearch - For Search | ||
|
||
5. CouchDB - NoSQL Data Store | ||
|
||
**Nginx** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:boron-slim | ||
FROM node:10.9.0-slim | ||
LABEL maintainer Mofesola Babalola <[email protected]> | ||
|
||
#Get required applications | ||
|
@@ -11,6 +11,7 @@ WORKDIR /usr/src/app | |
|
||
#Install Dependencies | ||
COPY package.json /usr/src/app | ||
COPY npm-shrinkwrap.json /usr/src/app | ||
RUN npm install --loglevel silent | ||
|
||
COPY . /usr/src/app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
#!/usr/bin/env bash | ||
# It will generally take about 40 seconds for elasticsearch and couchdb to be ready to receive connections | ||
echo 'Scheduling setup scripts to run in 40 seconds...' | ||
sleep 40 && /usr/src/app/conf/initcouch.sh 2>&1 && /usr/src/app/utils/elasticsearch.sh couchadmin test 2>&1 & | ||
sleep 40 | ||
/usr/src/app/conf/initcouch.sh 2>&1 && /usr/src/app/utils/elasticsearch.sh couchadmin test 2>&1 & | ||
|
||
echo 'Scheduling setup scripts to run in 120 seconds...' | ||
sleep 120 && /usr/src/app/conf/initcouch.sh 2>&1 && /usr/src/app/utils/elasticsearch.sh couchadmin test 2>&1 & | ||
npm start | ||
sleep 120 | ||
/usr/src/app/conf/initcouch.sh 2>&1 && /usr/src/app/utils/elasticsearch.sh couchadmin test 2>&1 & | ||
|
||
npm start |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, for instance, they try to postpone the script execution, but it doesn't work. Without
&&
it works as expected and really stops the script from the execution. I believe that was the expected behavior. Opinions?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your change is correct. Can we remove the part where it runs the scripts the second time? Is it possible they just included the second one because the first one always failed because it wasn't actually waiting the 40 seconds like it was supposed to?