You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/getting-started/production.rst
+171-24
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,61 @@ Building Production Containers
7
7
8
8
The production containers of Osler are slightly different than their development counterparts, and require a few extra steps to run. It is recommended to remove the local containers before continuing to prevent conflicts or confusion. This guide will use the generic production.yml docker-compose stack, but it is recommend to copy and customize it to your use case.
9
9
10
-
#. Install Docker_ per the Docker instructions for your platform.
10
+
Install Docker per the Docker instructions for your platform.
This file contains sensitive information about the Osler instance that would allow break confidentailty if exposed. As such, it must be created manually for each unique Osler instance. The file must be placed in :code:`osler/.envs/.production/.secrets`.
The key here is the `env_file` section, which sets some important environment variables. the file `./.envs/.secrets/.postgres` *does not exist*, and must be created. Create a file that looks something like:
60
+
61
+
62
+
Create the :code:`.secrets` file:
63
+
----------------------------------
64
+
This file contains sensitive information about the Osler instance that would allow break confidentailty if exposed. As such, it must be created manually for each unique Osler instance. It should never be check into git, and is ignored by git by default. The file must be placed in :code:`osler/.envs/.production/.secrets`.
28
65
The file should contain database credentials and the django secret key. **Do not use the values below. They are only an example**
29
66
30
67
.. code-block::
@@ -42,22 +79,132 @@ The production containers of Osler are slightly different than their development
In production, Osler should always be accessed exclusivly with HTTPS for security reasons. In the production compose stack, nginx automatically serves Osler using HTTPS with the SSL certificates at `osler/compose/production/certs/`. If you are using certificates issued by a third party, place them in this directory, ensuring the following permissions
47
-
.. code-block::
48
-
-rw-r--r-- cert.crt
49
-
-rw------- cert.key
50
-
Alternatively, you can generate your own certificates for nginx to use. Because these will be self-signed, they will cause all web browers to display a certificate warning the first time vising the site.
51
-
To generate certificates, run this from the root directory of Osler:
52
82
53
-
.. code-block:: console
83
+
The Web App
84
+
-----------
85
+
86
+
The web app is run with gunicorn in a custom Dockerfile. This guy accounts for by far the majority of the runtime of `docker-compose build`.
87
+
88
+
.. note::
89
+
We provide the postgres configuration environment files
90
+
(`.envs/.production/.postgres` and `./.envs/.secrets/.postgres`) to _both_
91
+
the django container and the postgres container. This is because the
92
+
django container needs to be able to connect and authenticate to the
Notice that we use the `environment` section to provide `DJANGO_SETTINGS_MODULE`, which points to `config/settings/production-demo.py`. This file contains:
121
+
122
+
.. code-block:: python
123
+
124
+
from .production import*
125
+
from .demo import*
126
+
127
+
Thus, it combines the configurations listed in `config/settings/production.py` and `config/settings/demo.py`, with those in `demo.py` overriding anything in `production.py` (since `demo.py` comes second). Most of the settings in `production.py` are strong recommendations for production, whereas those in `demo.py` are likely to be configured by you.
128
+
129
+
.. code-block:: python
130
+
from .base import env
131
+
132
+
TIME_ZONE="America/Chicago"
133
+
LANGUAGE_CODE="en-us"
134
+
135
+
OSLER_ROLE_DASHBOARDS= {
136
+
'Attending': 'dashboard-attending',
137
+
'Physician': 'dashboard-attending',
138
+
}
139
+
140
+
OSLER_DISPLAY_REFERRALS=False
141
+
OSLER_DISPLAY_APPOINTMENTS=False
142
+
OSLER_DISPLAY_CASE_MANAGERS=False
143
+
OSLER_DISPLAY_ATTESTABLE_BASIC_NOTE=False
144
+
OSLER_DISPLAY_DIAGNOSIS=False
145
+
OSLER_DISPLAY_VOUCHERS=False
146
+
OSLER_DISPLAY_WILL_RETURN=False
147
+
OSLER_DISPLAY_ATTENDANCE=True
148
+
OSLER_DISPLAY_FOLLOWUP=False
149
+
OSLER_DISPLAY_VACCINE=False
150
+
151
+
OSLER_DEFAULT_CITY="Gotham"
152
+
OSLER_DEFAULT_STATE="New Jersey"
153
+
OSLER_DEFAULT_ZIP_CODE="00000"
154
+
OSLER_DEFAULT_COUNTRY="USA"
155
+
OSLER_DEFAULT_ADDRESS=""
156
+
157
+
OSLER_ABOUT_NAME="About"
158
+
OSLER_ABOUT_URL="https://llemrconspiracy.org"
159
+
160
+
161
+
The Web Server
162
+
--------------
163
+
164
+
The web server we use is nginx. It's responsible for serving static files, terminating SSL, and passing data to gunicorn. The pertinent part of the docker compose file is here:
In production, Osler should always be accessed exclusivly with HTTPS for security reasons. In the production compose stack, nginx automatically serves Osler using HTTPS with the SSL certificates at `osler/compose/production/certs/`. If you are using certificates issued by a third party, place them in this directory, ensuring the following permissions
188
+
189
+
.. code-block::
190
+
191
+
-rw-r--r-- cert.crt
192
+
-rw------- cert.key
193
+
194
+
Alternatively, you can generate your own certificates for nginx to use. Because these will be self-signed, they will cause all web browers to display a certificate warning the first time vising the site.
195
+
To generate certificates, run this from the root directory of Osler:
This could take a while. Note: if you redo any previous steps, rerun this command with the :code:`--build` argument.
56
204
57
-
#. Build and run the docker containers (this could take a while). Note: if you redo any previous steps, rerun this command with the :code:`--build` argument.
58
-
.. code-block:: console
205
+
.. code-block:: console
59
206
60
-
$ docker-compose -f production.yml up
207
+
$ docker-compose -f production.yml up
61
208
62
209
63
-
#. Check everything is working by visiting https://localhost in your browser.
210
+
Check everything is working by visiting https://localhost in your browser.
0 commit comments