B2SHARE image build and stack deployment#
The B2SHARE deployment process:
Repo#
Clone B2SHARE repository:
git clone https://gitlab.eudat.eu/b2share/b2share-v3.git
Init the submodules#
cd b3share
git submodule init
git submodule update
Update env files#
cd inveniordm_deployment
cp b2share.env .env
cp b2share.app.env app.env
Update the secrets and the features in the app.env file.
More about configuration here.
Create necessary data directories#
The folders structure (${B2SHARE_DATADIR}) should look like this:
├── b2share_data
│ ├── archived_data
│ ├── static_data
│ └── uploaded_data
├── opensearch_data
├── postgres_data
└── rabbitmq_data
To create these directories run devscripts/create_dirs.sh
Create invenio.cfg#
copy “new_invenio.cfg” to “invenio.cfg”
cp new_invenio.cfg invenio.cfg
There is no need to update the invenio.cfg code until a new submodule is added or a new config module is added.
Build the app containers#
docker buildx build \
-f Dockerfile \
-t b2share-rdm/b2share:<tag> \
--build-arg BUILD_ASSETS=yes \
--build-arg GENERATE_PIPFILE_LOCK=yes \
.
Argument BUILD_ASSETS enables UI building as part of docker build. Argument GENERATE_PIPFILE_LOCK enables pipfile.lock file generation.
Update app in docker-services.yml with the image just built.
Start the stack#
Initialize the app#
Run everything at once with:
docker compose -f docker-compose.full.yml exec web-api /eudat/devscripts/init.sh
Steps:
(Run in container docker compose -f docker-compose.full.yml exec web-api bash)
- Init DB
invenio db init - Create tables
invenio db create - Update alembic versions
invenio alembic stamp - Set the file storage path
INVENIO_FILE_STORAGE_PATH=$(invenio shell --no-term-title -c "print(app.instance_path)")'/data' - Set default file storage
invenio files location create --default 'default-location' $INVENIO_FILE_STORAGE_PATH - Create administrator role
invenio roles create administrator - Allow administrator access
invenio access allow administration-access role administrator - Allow administration moderation
invenio access allow administration-moderation role administrator - Init search indices
invenio index init --force - Init record custom fields
invenio rdm-records custom-fields init - Init community custom fields
invenio communities custom-fields init - Add fixtures
invenio rdm-records fixtures - Generate static pages
invenio rdm pages create
Optional: Add affiliations, awards & funders#
docker compose -f docker-compose.full.yml exec web-api bash
invenio vocabularies update \
--vocabulary affiliations \
--origin ror-http
invenio vocabularies update --vocabulary funders --origin ror-http
# wget project.tar from https://doi.org/10.5281/zenodo.3516917
invenio vocabularies import \
--vocabulary awards \
--origin "/path/to/project.tar"
Optional: Add demo data#
To add demo data get API token from B2SHARE, add it to ./demo_data/upload_demo_data.py, and run:
python3 ./demo_data/upload_demo_data.py
B2SHARE docker compose stack definition#
The B2SHARE docker compose stack is split into two main files: docker-services.yml and docker-compose.full.yml. The docker-services.yml file defines images and configurations for B2SHARE support containers. The docker-compose.full.yml defines the actual container deployment, volumes and networks to use for the deployment.
Last update : 11.09.2026
Last review : 11.09.2026