WSL/SLF GitLab Repository

README.md 1.38 KB
Newer Older
Sam's avatar
Sam committed
1
2
# ckan-container

Sam's avatar
Sam committed
3
4
5
6
7
8
9
10
11
Containerised CKAN, Postgres, Solr using Docker.

Use cases:

- Replicating an existing database, then running a dev CKAN server.
- Running production CKAN with an existing database.

## Add secrets before running

Sam's avatar
Sam committed
12
**ckan.ini** contains the config for CKAN, including connection urls
Sam's avatar
Sam committed
13

Sam's avatar
Sam committed
14
**.postgres.secret** contains the password for postgres superuser only
Sam's avatar
Sam committed
15

Sam's avatar
Sam committed
16
**.db.secret** contains the postgres connection credentials for
Sam's avatar
Sam committed
17
the remote database (for replication), in format:
Sam's avatar
Sam committed
18
```
Sam's avatar
Sam committed
19
CKAN_DB_HOST=xxxxxx.wsl.ch
Sam's avatar
Sam committed
20
21
CKAN_DB_NAME=envidat
CKAN_DB_USER=xxenvidat
Sam's avatar
Sam committed
22
23
CKAN_DB_PASS=xxxxxx
CKAN_DOI_DB_NAME=envidat_doi
Sam's avatar
Sam committed
24
```
Sam's avatar
Sam committed
25

Sam's avatar
Sam committed
26
**.solr.secret** contains the credentials for setting and
Sam's avatar
Sam committed
27
connecting as users for Solr, in format:
Sam's avatar
Sam committed
28
```
Sam's avatar
Sam committed
29
30
SOLR_ADMIN_PASS=xxxxxx
SOLR_CKAN_PASS=xxxxxx
Sam's avatar
Sam committed
31
```
Sam's avatar
Sam committed
32

Sam's avatar
Sam committed
33
34
35
36
## Modify .env for environment

- Change the _INTERNAL_REG_ variable to match the desired container registry.

Sam's avatar
Sam committed
37
38
## Running

Sam's avatar
Sam committed
39
40
- Once the .env is configured, build the images with `docker compose build`
- Then once the secrets are set, run with `docker compose up -d`
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

## Reinstalling ckanext_xxx after editing

```bash
GIT_REPO=https://github.com/EnviDat/ckanext-cloudstorage.git
GIT_BRANCH=main

docker exec -it -u root:root ckan \
    bash -c 'apt update \
    && apt install git -y --no-install-recommends'

docker exec -it -u root:root ckan \
    pip install --upgrade --no-deps --force-reinstall \
    "git+${GIT_REPO}@${GIT_BRANCH}"
```