@@ -131,7 +131,7 @@ There should be four named Docker volumes (``docker volume ls | grep docker``).
131131prefixed with the Docker Compose project name (default: ``docker `` or value of host environment
132132variable ``COMPOSE_PROJECT_NAME ``.)
133133
134- * ``docker_ckan_config ``: home of ckan .ini
134+ * ``docker_ckan_config ``: home of production .ini
135135* ``docker_ckan_home ``: home of ckan venv and source, later also additional CKAN extensions
136136* ``docker_ckan_storage ``: home of CKAN's filestore (resource files)
137137* ``docker_pg_data ``: home of the database files for CKAN's default and datastore databases
@@ -167,14 +167,14 @@ against the database and import / export files from ``$VOL_CKAN_HOME``.
1671673. Datastore and datapusher
168168---------------------------
169169To enable the datastore, the datastore database and database users have to be created before
170- enabling the datastore and datapusher settings in the ``ckan .ini ``.
170+ enabling the datastore and datapusher settings in the ``production .ini ``.
171171
172172a. Create and configure datastore database
173173
174174With running CKAN containers, execute the built-in setup scripts against the ``db `` container::
175175
176176 docker exec -it db psql -U ckan -f 00_create_datastore.sql
177- docker exec ckan /usr/local/bin/ckan-paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan .ini | docker exec -i db psql -U ckan
177+ docker exec ckan /usr/local/bin/ckan-paster --plugin=ckan datastore set-permissions -c /etc/ckan/production .ini | docker exec -i db psql -U ckan
178178
179179The first script will create the datastore database and the datastore readonly user in the ``db ``
180180container. The second script is the output of ``paster ckan set-permissions `` - however,
@@ -189,13 +189,13 @@ The effect of these scripts is persisted in the named volume ``docker_pg_data``.
189189 Hard-coding the database table and usernames allows to prepare the set-permissions SQL script,
190190 while not exposing sensitive information to the world outside the Docker host environment.
191191
192- After this step, the datastore database is ready to be enabled in the ``ckan .ini ``.
192+ After this step, the datastore database is ready to be enabled in the ``production .ini ``.
193193
194- b. Enable datastore and datapusher in ``ckan .ini ``
194+ b. Enable datastore and datapusher in ``production .ini ``
195195
196- Edit the ``ckan .ini `` (note: requires sudo)::
196+ Edit the ``production .ini `` (note: requires sudo)::
197197
198- sudo vim $VOL_CKAN_CONFIG/ckan .ini
198+ sudo vim $VOL_CKAN_CONFIG/production .ini
199199
200200Add ``datastore datapusher `` to ``ckan.plugins `` and enable the datapusher option
201201``ckan.datapusher.formats ``.
@@ -209,7 +209,7 @@ The remaining settings required for datastore and datapusher are already taken c
209209 ``ckan.datastore.read_url = postgresql://datastore:DATASTORE_READONLY_PASSWORD@db/datastore ``
210210 are provided by ``docker-compose.yml ``.
211211
212- Restart the ``ckan `` container to apply changes to the ``ckan .ini ``::
212+ Restart the ``ckan `` container to apply changes to the ``production .ini ``::
213213
214214 docker-compose restart ckan
215215
@@ -222,15 +222,15 @@ Now the datastore API should return content when visiting::
222222-------------------------
223223With all images up and running, create the CKAN admin user (johndoe in this example)::
224224
225- docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckan sysadmin -c /etc/ckan/ckan .ini add johndoe
225+ docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckan sysadmin -c /etc/ckan/production .ini add johndoe
226226
227227Now you should be able to login to the new, empty CKAN.
228228The admin user's API key will be instrumental in tranferring data from other instances.
229229
230230---------------
2312315. Migrate data
232232---------------
233- This section illustrates the data migration from an existing CKAN instance ``SOURCE_CKAN ``
233+ This section illustrates the data migration from an existing CKAN instance ``SOURCE_CKAN ``
234234into our new Docker Compose CKAN instance assuming direct (ssh) access to ``SOURCE_CKAN ``.
235235
236236a. Transfer resource files
@@ -279,17 +279,17 @@ d. Rebuild search index
279279
280280Trigger a Solr index rebuild::
281281
282- docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckan search-index rebuild -c /etc/ckan/ckan .ini
282+ docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckan search-index rebuild -c /etc/ckan/production .ini
283283
284284-----------------
2852856. Add extensions
286286-----------------
287287There are two scenarios to add extensions:
288288
289289* Maintainers of production instances need extensions to be part of the ``ckan `` image and an
290- easy way to enable them in the ``ckan .ini ``.
290+ easy way to enable them in the ``production .ini ``.
291291 Automating the installation of existing extensions (without needing to change their source)
292- requires customizing CKAN's ``Dockerfile `` and scripted post-processing of the ``ckan .ini ``.
292+ requires customizing CKAN's ``Dockerfile `` and scripted post-processing of the ``production .ini ``.
293293* Developers need to read, modify and use version control on the extensions' source. This adds
294294 additional steps to the maintainers' workflow.
295295
@@ -302,7 +302,7 @@ For maintainers, the process is in summary:
302302a. Download and install extension from inside ``ckan `` container into ``docker_ckan_home `` volume
303303
304304The process is very similar to installing extensions in a source install. The only difference is
305- that the installation steps will happen inside the running container, and they will use the
305+ that the installation steps will happen inside the running container, and they will use the
306306virtualenv created inside the ckan image by CKAN's Dockerfile.
307307
308308The downloaded and installed files will be persisted in the named volume ``docker_ckan_home ``.
@@ -352,11 +352,11 @@ E.g., `ckanext-spatial <https://github.com/ckan/ckanext-spatial.git>`_::
352352
353353 # On the host
354354 docker exec -it db psql -U ckan -f 20_postgis_permissions.sql
355- docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan .ini
355+ docker exec -it ckan /usr/local/bin/ckan-paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/production .ini
356356
357- sudo vim $VOL_CKAN_CONFIG/ckan .ini
357+ sudo vim $VOL_CKAN_CONFIG/production .ini
358358
359- # Inside ckan .ini, add to [plugins]:
359+ # Inside production .ini, add to [plugins]:
360360 spatial_metadata spatial_query
361361
362362 ckanext.spatial.search_backend = solr
@@ -365,9 +365,9 @@ b. Modify CKAN config
365365
366366Follow the respective extension's instructions to set CKAN config variables::
367367
368- sudo vim $VOL_CKAN_CONFIG/ckan .ini
368+ sudo vim $VOL_CKAN_CONFIG/production .ini
369369
370- .. todo :: Demonstrate how to set ``ckan .ini`` settings from environment variables using
370+ .. todo :: Demonstrate how to set ``production .ini`` settings from environment variables using
371371 ``ckanext-envvars ``.
372372
373373c. Reload and debug
@@ -408,16 +408,16 @@ Option 1: Accessing the source from inside the container::
408408 # in extension folder:
409409 python setup.py install
410410 exit
411- # ... edit extension settings in ckan .ini and restart ckan container
412- sudo vim $VOL_CKAN_CONFIG/ckan .ini
411+ # ... edit extension settings in production .ini and restart ckan container
412+ sudo vim $VOL_CKAN_CONFIG/production .ini
413413 docker-compose restart ckan
414414
415415Option 2: Accessing the source from outside the container using ``sudo ``::
416416
417- sudo vim $VOL_CKAN_CONFIG/ckan .ini
417+ sudo vim $VOL_CKAN_CONFIG/production .ini
418418 sudo vim $VOL_CKAN_HOME/venv/src/ckanext-datawagovautheme/ckanext/datawagovautheme/templates/package/search.html
419419
420- Option 3:: The Ubuntu package ``bindfs `` makes the write-protected volumes accessible to a system
420+ Option 3: The Ubuntu package ``bindfs `` makes the write-protected volumes accessible to a system
421421user::
422422
423423 sudo apt-get install bindfs
@@ -436,7 +436,7 @@ user::
436436Changes in HTML templates and CSS will be visible right away.
437437For changes in code, we'll need to unmount the directory, change ownership back to the ``ckan ``
438438user, and follow the previous steps to ``python setup.py install `` and
439- ``pip install -r requirements.txt `` from within the running container, modify the ``ckan .ini ``
439+ ``pip install -r requirements.txt `` from within the running container, modify the ``production .ini ``
440440and restart the container::
441441
442442 sudo umount ~/VOL_CKAN_HOME
@@ -467,10 +467,10 @@ Variable substitution propagates as follows:
467467 (when building the images) and / or as run time variables (when running the containers).
468468* ``ckan-entrypoint.sh `` has access to all run time variables of the ``ckan `` service.
469469* ``ckan-entrypoint.sh `` injects environment variables (e.g. ``CKAN_SQLALCHEMY_URL ``) into the
470- running ``ckan `` container, overriding the CKAN config variables from ``ckan .ini ``.
470+ running ``ckan `` container, overriding the CKAN config variables from ``production .ini ``.
471471
472472See :doc: `/maintaining/configuration ` for a list of environment variables
473- (e.g. ``CKAN_SQLALCHEMY_URL ``) which CKAN will accept to override ``ckan .ini ``.
473+ (e.g. ``CKAN_SQLALCHEMY_URL ``) which CKAN will accept to override ``production .ini ``.
474474
475475After adding new or changing existing ``.env `` variables, locally built images and volumes may
476476need to be dropped and rebuilt. Otherwise, docker will re-use cached images with old or missing
@@ -508,4 +508,3 @@ A possible path towards a production-ready environment is:
508508* Transfer production data into the new server as described above using volume orchestration
509509 tools or transferring files directly.
510510* Bonus: contribute a write-up of working production setups to the CKAN documentation.
511-
0 commit comments