Skip to content

Commit

Permalink
Fix DB init; Update README; Set default dev URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolidori committed Nov 22, 2023
1 parent 0034f97 commit 1dac65a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're setting up a local environment for development and testing, you can le

## Running locally for development and testing

If you want to run this locally and don't want to deploy it anywhere, you must make a few changes before you can start the environment. Once you've gone through the steps below and started the environment, you can access CKAN at http://127.0.0.1:5000.
If you want to run this locally and don't want to deploy it anywhere, you must make a few changes before you can start the environment. Once you've gone through the steps below and started the environment, you can access CKAN at http://ckan:5000 (when creating secrets, don't change the default site URL).

**Note**: The "Install" and "Generate or update files with secrets" sections above are still required before proceeding with a local setup. After making the changes below, you can continue with the "Running a CKAN instance using the docker-compose environment" section.

Expand Down Expand Up @@ -109,6 +109,15 @@ ckan.plugins = image_view
googleanalytics # <-- Remove this line
```

### Hosts file entries

When using this environment locally, you must add the following entries to your hosts file (`nginx` is mentioned in the next section, but `ckan` is specific to the development and testing setup):

```
127.0.0.1 nginx
127.0.0.1 ckan
```

## Running a CKAN instance using the docker-compose environment

(optional) Clear any existing compose environment to ensure a fresh start
Expand Down
3 changes: 1 addition & 2 deletions ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ RUN CKAN_BRANCH="${CKAN_BRANCH:-ckan-2.8.1}" && CKAN_REPO="${CKAN_REPO:-ckan/cka
ARG PRE_INSTALL
RUN eval "${PRE_INSTALL}"

RUN ckan-pip install psycopg2-binary==2.8.4
RUN sed -i '/psycopg2/d' $CKAN_VENV/src/ckan/requirements.txt
RUN sed -i 's/psycopg2==2.4.5/psycopg2==2.7.3.2/g' $CKAN_VENV/src/ckan/requirements.txt

RUN touch $CKAN_VENV/src/ckan/requirement-setuptools.txt && ckan-pip install --index-url ${PIP_INDEX_URL:-https://pypi.org/simple/} --upgrade --no-cache-dir -r $CKAN_VENV/src/ckan/requirement-setuptools.txt
RUN touch $CKAN_VENV/src/ckan/requirements.txt && ckan-pip install --index-url ${PIP_INDEX_URL:-https://pypi.org/simple/} --upgrade --no-cache-dir -r $CKAN_VENV/src/ckan/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/ckan-secrets.dat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ckan required SMTP_SERVER mail.example.com Enter SMTP server address
ckan required SMTP_USER info Enter SMTP server username
ckan optional SMTP_PASSWORD empty Enter SMTP server password
ckan optional SMTP_MAIL_FROM empty Enter SMTP mail from
ckan optional CKAN_SITE_URL http://127.0.0.1:5000 Enter Website URL (including https:// or http://)
ckan required CKAN_SITE_URL http://ckan:5000 Enter Website URL (including https:// or http://)
ckan optional AWS_ACCESS_KEY_ID empty Enter AWS secret key (if any)
ckan optional AWS_SECRET_ACCESS_KEY empty AWS secret access key (if any)
ckan optional SENTRY_DSN https://<token>@sentry.io/<id> Enter Sentry DSN URL with token and ID
Expand Down

0 comments on commit 1dac65a

Please sign in to comment.