Skip to content

Commit

Permalink
Make database port configurable with env
Browse files Browse the repository at this point in the history
Also add documentation for the env variables to the README
  • Loading branch information
kaiamann committed Nov 12, 2024
1 parent aa1fb77 commit 54f2767
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 18 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
# WissKI Base image

- Base image: drupal:11.0.1-php8.3-apache-bookworm
- WissKI base recipe with version through env

## Configuration
This image can be configured using the following environment variables:

### Database settings
- `DB_DRIVER`: The used DBMS (e.g. mysql, mariadb, postgres)
- `DB_HOST`: Hostname where the DB is running (e.g. `localhost`)
- `DB_PORT`: Port on which DB is running
- `DB_NAME`: Name of the database (will be created)
- `DB_USER`: Name of the DB user (will be created)
- `DB_PASSWORD`: Password for `DB_USER` (will be set)

### Drupal settings
- `DOMAIN`: Domain of the WissKI (e.g. `localhost`)
- `DRUPAL_TRUSTED_HOST`: TODO: (e.g. `localhost`)
- `SITE_NAME`: Name of the site (e.g. `My WissKI`)
- `DRUPAL_USER`: Username for the Drupal user (will be created)
- `DRUPAL_PASSWORD`: Password for `DRUPAL_USER` (will be set)

### WissKI settings
# For a full list of versions see:
- `WISSKI_GRAIN_YEAST_WATER_VERSION`: Version of the wisski grain and water recepie. Look [here](https://packagist.org/packages/soda-collection-objects-data-literacy/wisski_grain_yeast_water) for available versions.
- `WISSKI_FLAVOURS`: List of flavours. TODO: how do you have to specify them here and where is a list of available flavours?
- `DEFAULT_GRAPH`: Full graph URI where WissKI data should be stored (e.g. `http://my.graph.uri/`)

### Triplestore settings
- `TS_READ_URL`: URL of the read endpoint of the triplestore (e.g. `http://public.graph.database/repositories/default`)
- `TS_WRITE_URL`: URL of the read endpoint of the triplestore (e.g. `http://public.graph.database/repositories/default/statements`)
- `TS_REPOSITORY`: Name of the repository (will be created)
- `TS_USERNAME`: Username for the Triplestore user (will be created)
- `TS_PASSWORD`: Password for `TS_USERNAME` (will be set)
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else
# Install the site
echo -e "\033[0;33mINSTALLING DRUPAL SITE...\033[0m"
{ drush si \
--db-url="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:3306/${DB_NAME}" \
--db-url="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}" \
--site-name="${SITE_NAME}" \
--account-name="${DRUPAL_USER}" \
--account-pass="${DRUPAL_PASSWORD}"
Expand Down
42 changes: 26 additions & 16 deletions example-env
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Database settings
DB_DRIVER=mysql
DB_HOST=
DB_NAME=
DB_PASSWORD=
DB_USER=
DEFAULT_GRAPH=
DOMAIN=
DRUPAL_USER=
DRUPAL_PASSWORD=
DRUPAL_TRUSTED_HOST=
SITE_NAME=
TS_PASSWORD=
TS_READ_URL=
TS_REPOSITORY=default
TS_USERNAME=
TS_WRITE_URL=
WISSKI_GRAIN_YEAST_WATER_VERSION=
DB_HOST=localhost
DB_PORT=3306
DB_NAME=drupal
DB_USER=drupal
tDB_PASSWORD=change_me

# Drupal settings
DOMAIN=localhost
DRUPAL_TRUSTED_HOST=localhost
DRUPAL_USER=admin
DRUPAL_PASSWORD=also_change_me
SITE_NAME=My WissKI

# WissKI settings
# For a full list of versions see: https://packagist.org/packages/soda-collection-objects-data-literacy/wisski_grain_yeast_water
WISSKI_GRAIN_YEAST_WATER_VERSION=dev-main
# For a full list of flavours see: TODO: add the link
WISSKI_FLAVOURS=
DEFAULT_GRAPH=http://my.graph/

# Triplestore settings
TS_READ_URL=http://public.graph.database/repositories/default
TS_WRITE_URL=http://public.graph.database/repositories/default/statements
TS_REPOSITORY=default
TS_USERNAME=admin
TS_PASSWORD=change_me_as_well

0 comments on commit 54f2767

Please sign in to comment.