jhannah / legislature_calendar

Calendars of legislature activity
Do What The F*ck You Want To Public License
2 stars 2 forks source link

Automate database refresh #6

Open jhannah opened 2 years ago

jhannah commented 2 years ago

Automate a nightly cron, or if we want to host via Docker we need a Docker provider #4 and Docker-enabled refresh mechanism? (Not sure what form that would take.)

barobba commented 2 years ago

We have this proof of concept working in Docker: https://github.com/barobba/legiscan-nebraska-docker

It imports everything into PostgreSQL. Currently, the database is also in Docker, but we can remove that and connect to another database outside of the Docker container.

jhannah commented 2 years ago

PostgreSQL is a far more serious database for scaling, if we want to jump from SQLite 👍

barobba commented 2 years ago

The Docker container and repo, are mainly so we can wrangle versioning (for both the Legiscan library, and the PHP environment).

It looks like the docker-compose.yaml can be ignored, since that just sets up a local DB instance for the proof of concept.

Instead, you will want to look at these files:

Also, this command ./php.sh <file-inside-source-directory> will run the script inside source directory from within the container.