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
{{ message }}
This repository was archived by the owner on Jun 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docker/README.rst
+23-41Lines changed: 23 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,10 @@ Setup
37
37
-----------------------------
38
38
To build a Docker application with the server and all its dependencies:
39
39
40
+
.. note::
41
+
42
+
You will need to enter the root user password several times during the following steps. Look for the ``Password:`` prompt, then enter your password. Note that **no characters** will be echoed when you type your password -- this is a normal security precaution built into Unix.
43
+
40
44
1. Install OS-dependent prerequisites
41
45
*************************************
42
46
@@ -137,9 +141,9 @@ The next command depends on the use case you chose in the previous step.
137
141
138
142
Pre-build
139
143
^^^^^^^^^
140
-
.. note::
144
+
.. warning::
141
145
142
-
OS X warning: On OS X, use ``python3 -m docker_tools`` instead of ``docker-tools`` in the following instructions. Likewise, use ``python3 -m rsmanage`` instead of ``rsmanage``.
146
+
On OS X, use ``python3 -m docker_tools`` instead of ``docker-tools`` in the following instructions. Likewise, use ``python3 -m rsmanage`` instead of ``rsmanage``.
143
147
144
148
For the use case of running the server, execute:
145
149
@@ -231,11 +235,11 @@ Introducing ``rsmanage``
231
235
^^^^^^^^^^^^^^^^^^^^^^^^
232
236
The ``rsmanage`` command will run many useful commands inside the container for you. With ``rsmanage`` you can:
233
237
234
-
* Add a course - ``rsmanage addcourse``
235
-
* Add a user - ``rsmanage adduser``
236
-
* Get information about a course ``rsmanage courseinfo``
237
-
* Build a book - ``rsmanage build --course bookname``
238
-
* Get a database shell in the current database - ``rsmanage db``
238
+
* Add a course - ``rsmanage addcourse``
239
+
* Add a user - ``rsmanage adduser``
240
+
* Get information about a course ``rsmanage courseinfo``
241
+
* Build a book - ``rsmanage build --course bookname``
242
+
* Get a database shell in the current database - ``rsmanage db``
239
243
240
244
...and many other things. Just type ``rsmanage`` for a list of things it can do. For a list of options just type ``rsmanage`` and the subcommand you want followed by ``--help``; for example, ``rsmanage build --help``.
241
245
@@ -345,17 +349,7 @@ trying to load the same records and entering a restart loop because the records
345
349
346
350
Operation
347
351
---------
348
-
To run the containerized application after a stop/reboot/etc.:
349
-
350
-
#. On WSL or OS X, run the Docker Desktop.
351
-
#. In a terminal, stop any currently-running containers:
352
-
353
-
.. code:: bash
354
-
355
-
docker-compose stop
356
-
357
-
#. Next, start them by following the directions in `5. Starting the containerized application`_.
358
-
352
+
The containerized application is configured to automatically start as soon as Docker / the Docker Desktop is started. Therefore, on OS X or Windows (when using WSL2): after a reboot or after manually shutting down the Docker Desktop, remember to start the Docker Desktop application.
359
353
360
354
361
355
Other Tips & Tricks
@@ -414,26 +408,17 @@ To install a VNC client on Linux, execute ``sudo apt install gvncviewer``. Next,
414
408
415
409
Execute ``sudo apt install openssh-server`` to install a SSH server. This allows easy access from VSCode, as well as usual SSH access.
416
410
417
-
Runestone Components / BookServer Development
411
+
Developer notes
418
412
***********************************************
419
413
420
-
If you are doing development work on Runestone itself, you will want to install the RunestoneComponents and/or the BookServer from source. To do this, rebuild the image with the ``--single-dev`` option:
421
-
422
-
.. code-block:: bash
423
-
424
-
docker-tools build --single-dev
425
-
docker-compose up
414
+
If you make changes to the Runestone Components, you must rebuild the bundle of JavaScript bundle produced by webpack using ``npm run build``, then re-build the book (or page of a book) which uses the component you're editing via a ``runestone build`` or ``pretext build``. The unit tests do this automatically; for development, it's easiest to make changes to the test then re-run the test to guarantee the correct builds are done.
426
415
427
-
This command automatically clones the `RunestoneComponents <https://github.com/RunestoneInteractive/RunestoneComponents>`_ and/or the `BookServer <https://github.com/bnmnetp/BookServer>`_
428
-
as a sibling of the root directory. Use the ``docker-tools build --clone-all/bks/rc/rs`` options to clone your repositories.
416
+
If you make changes to the BookServer, you'll need to stop then restart the BookServer. To do this, use ``docker-tools start-servers`` / ``docker-tools stop-servers``.
429
417
430
-
As you make changes to Runestone Components or the BookServer, you should not have to restart the Docker containerized application. Any rebuild
431
-
of a book should immediately use the new code. This is because the host filesystem is mounted as a `volume <https://docs.docker.com/storage/volumes/>`_ in the container; see the generated ``docker-compose.overrides.yaml`` file.
418
+
If you make changes to the Runestone server, most changes will be immediately applied. However, changes in the ``modules`` folder require a stop / start sequence to apply these changes.
432
419
433
420
You can run the unit tests in the container using the ``docker-tools test`` command.
434
421
435
-
To start or stop the servers, use ``docker-tools start-servers`` / ``docker-tools stop-servers``. While changes to web2py controllers don't require a server restart, any changes to code in the ``modules`` folder does.
436
-
437
422
Testing the Entrypoint
438
423
**********************************
439
424
@@ -449,28 +434,25 @@ File Permissions
449
434
**********************************
450
435
451
436
File permissions can seem a little strange when you start this container on Linux. Primarily because both
452
-
nginx and uwsgi run as the ``www-data`` user. So you will suddenly find your files under RunestoneServer
437
+
nginx and Gunicorn run as the ``www-data`` user. So you will suddenly find your files under RunestoneServer
453
438
owned by ``www-data`` . The container's entry point script updates permissions to allow both you and the
454
439
container enough privileges to do your work.
455
440
456
441
Writing Your Own Book
457
442
**********************************
458
443
459
-
If you are writing your own book you will want to get that book set up properly in the runestone
444
+
If you are writing your own book you will want to get that book set up properly in the Runestone
460
445
system. You need to do the following:
461
446
462
-
1. Run the command ``rsmanage addcourse`` Use the project name you configured in ``pavement.py`` as
463
-
the name of BOTH the course and the basecourse when it asks.
464
-
447
+
#. Run the command ``rsmanage addcourse``. Use the project name you configured in ``pavement.py`` as the name of BOTH the course and the basecourse when it asks.
465
448
466
-
1. Now that your course is registered rebuild it using the command ``rsmanage build --course <book_name>`` command.
449
+
#. Now that your course is registered, rebuild it using the command ``rsmanage build --course <book_name>`` command.
467
450
468
-
2. If this book is a PreTeXt book you will need to navigate to the directory that contains the
469
-
``runestone-manifest.xml`` file and run the command:
451
+
#. If this book is a PreTeXt book you will need to navigate to the directory that contains the ``runestone-manifest.xml`` file and run the command:
0 commit comments