transport-data / tdc-data-portal

https://tdc-data-portal.vercel.app
1 stars 1 forks source link

Docker Compose setup for TDC

1. User guide (For non devs)

Instructions on how to use the final product once deployed can be found in the docs folder, below is a table of contents with all the current documentation pages

2. Quickstart

Run the backend

Run the frontend

Run tests

3. Applying patches

When building your project specific CKAN images (the ones defined in the ckan/ folder), you can apply patches to CKAN core or any of the built extensions. To do so create a folder inside ckan/patches with the name of the package to patch (ie ckan or ckanext-??). Inside you can place patch files that will be applied when building the images. The patches will be applied in alphabetical order, so you can prefix them sequentially if necessary.

For instance, check the following example image folder:

ckan
├── patches
│   ├── ckan
│   │   ├── 01_datasets_per_page.patch
│   │   ├── 02_groups_per_page.patch
│   │   ├── 03_or_filters.patch
│   └── ckanext-harvest
│       └── 01_resubmit_objects.patch
├── setup
└── Dockerfile.dev

4. envvars

The ckanext-envvars extension is used in the CKAN Docker base repo to build the base images. This extension checks for environmental variables conforming to an expected format and updates the corresponding CKAN config settings with its value.

For the extension to correctly identify which env var keys map to the format used for the config object, env var keys should be formatted in the following way:

All uppercase
Replace periods ('.') with two underscores ('__')
Keys must begin with 'CKAN' or 'CKANEXT', if they do not you can prepend them with 'CKAN___'

For example:

These parameters can be added to the .env file

For more information please see ckanext-envvars

5. Manage new users

  1. Create a new user from the Docker host, for example to create a new user called 'admin'

    docker exec -it <container-id> ckan -c ckan.ini user add admin email=admin@localhost

    To delete the 'admin' user

    docker exec -it <container-id> ckan -c ckan.ini user remove admin

  2. Create a new user from within the ckan container. You will need to get a session on the running container

    ckan -c ckan.ini user add admin email=admin@localhost

    To delete the 'admin' user

    ckan -c ckan.ini user remove admin