|
3 | 3 | Running a LNT Server |
4 | 4 | ==================== |
5 | 5 |
|
6 | | -Running a LNT server locally is easy and can be sufficient for basic tasks. To do |
7 | | -so: |
| 6 | +We provide a Docker Compose service that brings up a LNT web server attached |
| 7 | +to a Postgres database. To start the server, run:: |
8 | 8 |
|
9 | | -#. Install ``lnt`` as explained in the :ref:`installation section <installation>`. |
10 | | - |
11 | | -#. Create a LNT installation:: |
12 | | - |
13 | | - lnt create path/to/installation |
14 | | - |
15 | | - This will create the LNT configuration file and the default database at the |
16 | | - specified path. |
17 | | - |
18 | | -#. You can then run the server on that installation:: |
| 9 | + docker compose -f docker/compose.yaml --env-file docker/dev.env up |
19 | 10 |
|
20 | | - lnt runserver path/to/installation |
| 11 | +Once the server is running, you are ready to submit data to it. See the section |
| 12 | +on :ref:`importing data <importing_data>` for details. |
21 | 13 |
|
22 | | - Note that running the server in this way is not recommended for production, since |
23 | | - this server is single-threaded and uses a SQLite database. |
| 14 | +The ``dev.env`` file provides default secrets suitable for local use. For your |
| 15 | +own deployment, create an env file with your own values for ``LNT_DB_PASSWORD`` |
| 16 | +and ``LNT_AUTH_TOKEN``. Refer to the Docker Compose file for all available |
| 17 | +environment variables. |
24 | 18 |
|
25 | | -#. You are now ready to submit data to the server. See the section on :ref:`importing data <importing_data>` |
26 | | - for details. |
| 19 | +Adding an Nginx Reverse Proxy |
| 20 | +----------------------------- |
27 | 21 |
|
28 | | -#. While the above is enough for most use cases, you can also customize your installation. |
29 | | - To do so, edit the generated ``lnt.cfg``, for example to: |
| 22 | +To add an Nginx reverse proxy in front of the webserver (as done for the |
| 23 | +lnt.llvm.org deployment), use the ``nginx`` profile:: |
30 | 24 |
|
31 | | - a. Update the databases list. |
32 | | - b. Update the public URL the server is visible at. |
33 | | - c. Update the ``nt_emailer`` configuration. |
| 25 | + docker compose -f docker/compose.yaml --profile nginx --env-file <env-file> up |
34 | 26 |
|
| 27 | +This starts the Nginx service on port 80 (configurable via |
| 28 | +``LNT_NGINX_EXTERNAL_PORT``) in addition to the database and webserver. |
35 | 29 |
|
36 | | -Server Architecture |
37 | | -------------------- |
| 30 | +Running without Docker |
| 31 | +---------------------- |
38 | 32 |
|
39 | | -The LNT web app is currently implemented as a Flask WSGI web app, with Jinja2 |
40 | | -for the templating engine. The hope is to eventually move to a more AJAXy web |
41 | | -interface. The database layer uses SQLAlchemy for its ORM, and is typically |
42 | | -backed by SQLite or Postgres. |
| 33 | +Running a ``lnt`` server outside Docker is possible too: |
43 | 34 |
|
44 | | -Running a Production Server on Docker |
45 | | -------------------------------------- |
| 35 | +#. Install ``lnt`` as explained in the :ref:`installation section <installation>`. |
46 | 36 |
|
47 | | -We provide a Docker Compose service that can be used to easily bring up a fully working |
48 | | -production server within minutes. The service can be built and run with:: |
| 37 | +#. Create a LNT installation:: |
49 | 38 |
|
50 | | - docker compose --file docker/compose.yaml --env-file <env-file> up |
| 39 | + lnt create path/to/installation |
51 | 40 |
|
52 | | -``<env-file>`` should be the path to a file containing environment variables |
53 | | -required by the containers. Please refer to the Docker Compose file for details. |
54 | | -This service runs a Nginx server that acts as a reverse proxy for the LNT web |
55 | | -server, which is itself attached to a Postgres database. For production use, we |
56 | | -recommend using this service and tweaking the desired aspects in your custom setup |
57 | | -(for example redirecting ports or changing volume binds). |
| 41 | +#. You can then run the server on that installation:: |
58 | 42 |
|
59 | | -Rebuilding the LNT Webserver Docker Image |
60 | | ------------------------------------------ |
| 43 | + lnt runserver path/to/installation |
61 | 44 |
|
62 | | -By default, the Docker compose setup will use a published version of the LNT |
63 | | -Docker image from ghcr.io. To use a locally-built Docker image instead, use:: |
| 45 | +Note that running the server in this way is not recommended for production, since |
| 46 | +it runs a single-threaded Flask server instead of running behind ``gunicorn``. |
64 | 47 |
|
65 | | - docker build --file docker/lnt.dockerfile . |
| 48 | +Server Architecture |
| 49 | +------------------- |
66 | 50 |
|
67 | | -and then replace the Docker image in the Docker compose file. |
| 51 | +The LNT web app is implemented as a Flask WSGI web app, with Jinja2 for the |
| 52 | +templating engine. The database layer uses SQLAlchemy for its ORM, backed by |
| 53 | +Postgres. |
0 commit comments