-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Update-healthcheck-to-Docker-Compose
- Loading branch information
Showing
6 changed files
with
42 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ The CKAN images used are from the official CKAN [ckan-docker](https://github.com | |
|
||
The non-CKAN images are as follows: | ||
|
||
* DataPusher: CKAN's [pre-configured DataPusher image](https://github.com/ckan/ckan-base/tree/main/datapusher). | ||
* DataPusher: CKAN's [pre-configured DataPusher image](https://github.com/ckan/ckan-docker-base/tree/main/datapusher). | ||
* PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume. | ||
* Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). Index data is stored in a named volume. | ||
* Redis: standard Redis image | ||
|
@@ -61,10 +61,8 @@ Use this if you are a maintainer and will not be making code changes to CKAN or | |
|
||
Copy the included `.env.example` and rename it to `.env`. Modify it depending on your own needs. | ||
|
||
Please note that when accessing CKAN directly (via a browser) ie: not going through NGINX you will need to make sure you have "ckan" set up | ||
to be an alias to localhost in the local hosts file. Either that or you will need to change the `.env` entry for `CKAN_SITE_URL` | ||
|
||
Using the default values on the `.env.example` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD`(`ckan_admin` and `test1234` by default). This should be obviously changed before running this setup as a public CKAN instance. | ||
> [!WARNING] | ||
> There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). These must be changed before running this setup as a public CKAN instance. | ||
To build the images: | ||
|
||
|
@@ -78,11 +76,20 @@ This will start up the containers in the current window. By default the containe | |
using a different colour. You could also use the -d "detach mode" option ie: `docker compose up -d` if you wished to use the current | ||
window for something else. | ||
|
||
At the end of the container start sequence there should be 6 containers running | ||
At the end of the container start sequence there should be 6 containers running: | ||
|
||
![Screenshot 2022-12-12 at 10 36 21 am](https://user-images.githubusercontent.com/54408245/207012236-f9571baa-4d99-4ffe-bd93-30b11c4829e0.png) | ||
```bash | ||
$ docker compose ps | ||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS | ||
ckan-docker-ckan-1 ckan-docker-ckan "/srv/app/start_ckan…" ckan 4 minutes ago Up 3 minutes (healthy) 5000/tcp | ||
ckan-docker-datapusher-1 ckan/ckan-base-datapusher:0.0.20 "sh -c 'uwsgi --plug…" datapusher 4 minutes ago Up 4 minutes (healthy) 8800/tcp | ||
ckan-docker-db-1 ckan-docker-db "docker-entrypoint.s…" db 4 minutes ago Up 4 minutes (healthy) | ||
ckan-docker-nginx-1 ckan-docker-nginx "/bin/sh -c 'openssl…" nginx 4 minutes ago Up 2 minutes 80/tcp, 0.0.0.0:8443->443/tcp | ||
ckan-docker-redis-1 redis:6 "docker-entrypoint.s…" redis 4 minutes ago Up 4 minutes (healthy) | ||
ckan-docker-solr-1 ckan/ckan-solr:2.10-solr9 "docker-entrypoint.s…" solr 4 minutes ago Up 4 minutes (healthy) | ||
``` | ||
|
||
After this step, CKAN should be running at `CKAN_SITE_URL`. | ||
After this step, CKAN should be running at `CKAN_SITE_URL` (by default https://localhost:8443) | ||
|
||
|
||
### Development mode | ||
|
@@ -106,12 +113,29 @@ See [CKAN images](#5-ckan-images) for more details of what happens when using de | |
|
||
You can use the ckan [extension](https://docs.ckan.org/en/latest/extensions/tutorial.html#creating-a-new-extension) instructions to create a CKAN extension, only executing the command inside the CKAN container and setting the mounted `src/` folder as output: | ||
|
||
docker compose -f docker-compose.dev.yml exec ckan-dev /bin/sh -c "ckan -c /srv/app/ckan.ini generate extension --output-dir /srv/app/src_extensions" | ||
```bash | ||
docker compose -f docker-compose.dev.yml exec ckan-dev ckan generate extension --output-dir /srv/app/src_extensions | ||
``` | ||
|
||
``` | ||
Extension's name [must begin 'ckanext-']: ckanext-mytheme | ||
Author's name []: Joe Bloggs | ||
Author's email []: [email protected] | ||
Your Github user or organization name []: example | ||
Brief description of the project []: My CKAN theme | ||
List of keywords (separated by spaces) [CKAN]: | ||
Do you want to include code examples? [y/N]: y | ||
Written: /srv/app/src_extensions/ckanext-mytheme | ||
``` | ||
|
||
![Screenshot 2023-02-22 at 1 45 55 pm](https://user-images.githubusercontent.com/54408245/220623568-b4e074c7-6d07-4d27-ae29-35ce70961463.png) | ||
The new extension files and directories are created in the `/srv/app/src_extensions/` folder in the running container. They will also exist in the local src/ directory as local `/src` directory is mounted as `/srv/app/src_extensions/` on the ckan container. | ||
|
||
The files will be owned by root, to correct the ownership so you can edit the files with your normal account outside the container run: | ||
|
||
The new extension files and directories are created in the `/srv/app/src_extensions/` folder in the running container. They will also exist in the local src/ directory as local `/src` directory is mounted as `/srv/app/src_extensions/` on the ckan container. You might need to change the owner of its folder to have the appropiate permissions. | ||
```bash | ||
docker compose -f docker-compose.dev.yml exec ckan-dev chown --reference /srv/app/src_extensions/ -R /srv/app/src_extensions/ckanext-mytheme/ | ||
``` | ||
|
||
#### Running HTTPS on development mode | ||
|
||
|
@@ -314,8 +338,7 @@ For convenience the CKAN_SITE_URL parameter should be set in the .env file. For | |
|
||
## 12. Changing the base image | ||
|
||
The base image used in the CKAN Dockerfile and Dockerfile.dev can be changed so a different DockerHub image is used eg: ckan/ckan-base:2.9.9 | ||
could be used instead of ckan/ckan-base:2.10.1 | ||
The base image used in the CKAN Dockerfile and Dockerfile.dev can be changed so a different DockerHub image is used eg: ckan/ckan-base:2.10.5 can be used instead of ckan/ckan-base:2.11.0 | ||
|
||
## 13. Replacing DataPusher with XLoader | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.