|
17 | 17 | # |
18 | 18 | # - Single-container: these commands creates a container designed to execute on a single server. The Dockerized applications associated with it include Jobe, Redis, and Postgres. A volume is used to persist data, such as updates to the server. |
19 | 19 | # |
20 | | -# - Production mode (the default): ``docker-tool build --single`` creates a container designed for production (which includes obtaining an HTTPS certificate). |
| 20 | +# - Production mode (the default): ``docker-tools build --single`` creates a container designed for production (which includes obtaining an HTTPS certificate). |
21 | 21 | # |
22 | 22 | # - Development mode: ``docker-tools build --single-dev`` creates a container supporting a development mode, which provides additional tools and installs the BookServer and Runestone Components from github, instead of from releases on PyPI. |
23 | 23 | # |
@@ -868,6 +868,7 @@ def _build_phase_1( |
868 | 868 | # ``sphinxcontrib.paverutils.run_sphinx`` lacks venv support -- it doesn't use ``sys.executable``, so it doesn't find ``sphinx-build`` in the system path when executing ``/srv/venv/bin/runestone`` directly, instead of activating the venv first (where it does work). As a huge, ugly hack, symlink it to make it available in the system path. |
869 | 869 | "ln -sf $RUNESTONE_PATH/.venv/bin/sphinx-build /usr/local/bin", |
870 | 870 | # Deal with a different subdirectory layout inside the container (mandated by web2py) and outside the container by adding these symlinks. |
| 871 | + # TODO: should only do this in dev |
871 | 872 | "ln -sf $BOOK_SERVER_PATH $WEB2PY_PATH/applications/BookServer", |
872 | 873 | # We can't use ``$BOOK_SERVER_PATH`` here, since we need ``/srv/bookserver-dev`` in lowercase, not CamelCase. |
873 | 874 | "ln -sf /srv/bookserver-dev $WEB2PY_PATH/applications/bookserver-dev", |
@@ -1044,7 +1045,9 @@ def _build_phase_2_core( |
1044 | 1045 | xqt("rm -f $RUNESTONE_PATH/databases/*") |
1045 | 1046 | print("Populating database...") |
1046 | 1047 | xqt("rsmanage initdb --force", cwd=env.WEB2PY_PATH) |
1047 | | - xqt("alembic stamp head", cwd=env.BOOK_SERVER_PATH) |
| 1048 | + # Should only use alembic in dev mode. |
| 1049 | + if build_config.is_dev(): |
| 1050 | + xqt("alembic stamp head", cwd=env.BOOK_SERVER_PATH) |
1048 | 1051 | else: |
1049 | 1052 | print("Database already populated.") |
1050 | 1053 | # TODO: any checking to see if the db is healthy? Perhaps run Alembic autogenerate to see if it wants to do anything? |
|
0 commit comments