Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit e75d560

Browse files
committed
Merge branch 'master' of github.com:RunestoneInteractive/RunestoneServer
2 parents 7f49355 + 1ec5e5d commit e75d560

File tree

3 files changed

+27
-42
lines changed

3 files changed

+27
-42
lines changed

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ services:
77
jobe:
88
image: runestone/jobeinabox
99
build: ./jobeinabox/
10+
restart: always
1011
volumes:
1112
- ./jobeinabox/files:/usr/local/lib/java
1213
runestone:
1314
image: runestone/server
14-
restart: on-failure
15+
restart: always
1516
ports:
1617
# Allow HTTP, so the web server can forward to https.
1718
- "80:80"

docker/README.rst

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Setup
3737
-----------------------------
3838
To build a Docker application with the server and all its dependencies:
3939

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+
4044
1. Install OS-dependent prerequisites
4145
*************************************
4246

@@ -137,9 +141,9 @@ The next command depends on the use case you chose in the previous step.
137141

138142
Pre-build
139143
^^^^^^^^^
140-
.. note::
144+
.. warning::
141145

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``.
143147

144148
For the use case of running the server, execute:
145149

@@ -231,11 +235,11 @@ Introducing ``rsmanage``
231235
^^^^^^^^^^^^^^^^^^^^^^^^
232236
The ``rsmanage`` command will run many useful commands inside the container for you. With ``rsmanage`` you can:
233237

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``
239243

240244
...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``.
241245

@@ -345,17 +349,7 @@ trying to load the same records and entering a restart loop because the records
345349

346350
Operation
347351
---------
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.
359353

360354

361355
Other Tips & Tricks
@@ -414,26 +408,17 @@ To install a VNC client on Linux, execute ``sudo apt install gvncviewer``. Next,
414408

415409
Execute ``sudo apt install openssh-server`` to install a SSH server. This allows easy access from VSCode, as well as usual SSH access.
416410

417-
Runestone Components / BookServer Development
411+
Developer notes
418412
***********************************************
419413

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.
426415

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``.
429417

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.
432419

433420
You can run the unit tests in the container using the ``docker-tools test`` command.
434421

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-
437422
Testing the Entrypoint
438423
**********************************
439424

@@ -449,28 +434,25 @@ File Permissions
449434
**********************************
450435

451436
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
453438
owned by ``www-data`` . The container's entry point script updates permissions to allow both you and the
454439
container enough privileges to do your work.
455440

456441
Writing Your Own Book
457442
**********************************
458443

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
460445
system. You need to do the following:
461446

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.
465448

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.
467450

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:
470452

471-
.. code-block:: bash
453+
.. code-block:: bash
472454
473-
runestone process-manifest --course <yourcourse> --manifest runestone-manifest.xml
455+
runestone process-manifest --course <yourcourse> --manifest runestone-manifest.xml
474456
475457
.. note::
476458

docker/docker_tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,15 @@ def _build_phase_0(
552552
db:
553553
image:
554554
postgres:13
555+
restart: always
555556
environment:
556557
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
557558
POSTGRES_USER: ${POSTGRES_USER}
558559
POSTGRES_DBNAME: ${POSTGRES_DBNAME}
559560
560561
redis:
561562
image: redis
563+
restart: always
562564
563565
runestone:
564566
${DEV_MISC}

0 commit comments

Comments
 (0)