-
Notifications
You must be signed in to change notification settings - Fork 13
pycsw with Postgres
Dan Nowacki edited this page Mar 6, 2020
·
1 revision
This is the modern (2020) way we are running pycsw on gamone. After lots of issues with sqlite as the db we moved to Postgres.
- Modify docker-compose.yml following general format at https://github.com/axiom-data-science/docker-pycsw. This is what the relevant snippet looks like:
image: kartoza/postgis:11.0-2.5
stop_signal: SIGINT
environment:
POSTGRES_DBNAME: pycsw
POSTGRES_USER: pycsw
POSTGRES_PASS: pycsw
volumes:
- /opt/docker/postgres/data/db:/var/lib/postgresql
pycsw:
image: axiom/docker-pycsw:latest
volumes:
- /opt/docker/pycsw/usgs-cmg.cfg:/opt/pycsw/default.cfg
- /opt/docker/pycsw/force:/force
- /opt/docker/pycsw/export:/export
- /opt/docker/pycsw/store:/store
ports:
- "8000:8000"
depends_on:
- postgres
-
Update
usgs-cmg.cfg
to use postgres as the database. Insert this text at the relevant line, and comment out the sqlite line:database=postgresql://pycsw:pycsw@postgres/pycsw
-
Migrate directories. I moved the old pycsw directory to a backup and created a new, empty
/opt/docker/pycsw
directory. In here I placed theusgs-cmg.cfg
file (updated with the postgres line above) and theexport
,force
,store
directores; otherwise the container won't start. -
Start Postgres
docker-compose up -d postgres
- Restart pycsw
docker-compose stop pycsw
docker-compose up -d pycsw