Update README.md and change default .env to .env.example

This will make it easy to clone the repository, and the custom .env will remain intact.
This commit is contained in:
mjanez 2023-04-18 20:00:51 +02:00 committed by GitHub
parent 46c5a37713
commit 47a26dc021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 32 deletions

View File

5
.gitignore vendored
View File

@ -10,4 +10,7 @@ local/*
.vscode .vscode
__pycache__ __pycache__
log log
metadata metadata
# environment
.env

View File

@ -57,7 +57,7 @@ Optional HTTP Endpoint ([`docker-compose.nginx.yml`](/docker-compose.nginx.yml))
| [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | NGINX 1.22.1 | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 9.74 MB | No routing, only CKAN. Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) | | [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | NGINX 1.22.1 | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 9.74 MB | No routing, only CKAN. Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) |
The site is configured using environment variables that you can set in the `.env` file for an Apache HTTP Server and ckan-pycsw deployment, or replace it with the [`.env.nginx.example`](/samples/.env.nginx.example) for a NGINX and CKAN-only deployment using the Docker Compose file: [`docker-compose.nginx.yml`](/docker-compose.nginx.yml). The site is configured using environment variables that you can set in the `.env` file for an Apache HTTP Server and ckan-pycsw deployment (default `.env.example`), or replace it with the [`.env.nginx.example`](/samples/.env.nginx.example) for a NGINX and CKAN-only deployment using the Docker Compose file: [`docker-compose.nginx.yml`](/docker-compose.nginx.yml).
### ckan-docker roadmap ### ckan-docker roadmap
@ -170,45 +170,49 @@ docker compose [-p <my_project>] down
### Base mode ### Base mode
Use this if you are a maintainer and will not be making code changes to CKAN or to CKAN extensions. Use this if you are a maintainer and will not be making code changes to CKAN or to CKAN extensions.
Clone project 1. Clone project
```shell ```shell
cd /path/to/my/project cd /path/to/my/project
git clone https://github.com/mjanez/ckan-docker.git git clone https://github.com/mjanez/ckan-docker.git
``` ```
Modify [`.env`](/.env) depending on your own needs. 2. Copy the `.env.example` template (or use another from [`/samples/`](/samples/)) and modify the resulting `.env` to suit your needs.
- **Apache HTTP Server & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `APACHE_SERVER_NAME`, `APACHE_CKAN_LOCATION`, `APACHE_PYCSW_LOCATION`, etc.). ```shell
cp .env.example .env
```
- **NGINX only CKAN**: Replace the [`.env`](/.env) with the [`.env.nginx.example`](/samples/.env.nginx.example) and modify the variables as needed. - **Apache HTTP Server & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `APACHE_SERVER_NAME`, `APACHE_CKAN_LOCATION`, `APACHE_PYCSW_LOCATION`, etc.).
>**Note**:<br> - **NGINX only CKAN**: Replace the [`.env`](/.env) with the [`/samples/.env.nginx.example`](/samples/.env.nginx.example) and modify the variables as needed.
> Please note that when accessing CKAN directly (via a browser) ie: not going through Apache/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`
>**Warning**:<br> >**Note**:<br>
> Using the default values on the `.env` 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.** > Please note that when accessing CKAN directly (via a browser) ie: not going through Apache/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`
To build the images: >**Warning**:<br>
```bash > Using the default values on the `.env` 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.**
docker compose build
``` 3. Build the images:
>**Note**<br> ```bash
> NGINX CKAN without ckan-pycsw and Apache: docker compose build
>```bash ```
>docker compose -f docker-compose.nginx.yml build >**Note**<br>
>``` > NGINX CKAN without ckan-pycsw and Apache:
>```bash
>docker compose -f docker-compose.nginx.yml build
>```
To start the containers: 4. Start the containers:
```bash ```bash
docker compose up docker compose up
``` ```
>**Note**<br> >**Note**<br>
> NGINX CKAN without ckan-pycsw and Apache: > NGINX CKAN without ckan-pycsw and Apache:
>```bash >```bash
>docker compose -f docker-compose.nginx.yml up >docker compose -f docker-compose.nginx.yml up
>``` >```
This will start up the containers in the current window. By default the containers will log direct to this window with each container This will start up the containers in the current window. By default the containers will log direct to this window with each container
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 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