Automated crime event Twitter feed bot for Halifax, NS
- cp .env-example .env
- update env variables (GOOGLE_API_KEY, MAIL_HOST, etc.)
- docker-compose up [-d]
- go to http://localhost:1902
docker-compose restart
docker-compose logs -f
docker-compose ps
docker-compose down -v
docker-compose exec php bash
docker-compose up -d --build
or just:
docker-compose build
docker-compose exec php python halicrime.py load_data
and:
docker-compose exec php php notifier.php
docker-compose exec mysql bash -c 'mysqldump -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" --databases db' > ./docker/db_dump.sql
docker-compose exec -T mysql bash -c 'mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" --force' < ./docker/db_dump.sql
On a fresh install, have the sql dump as a volume in docker-compose.yml:
- ./docker/db_dump.sql:/docker-entrypoint-initdb.d/db_dump.sql
docker-compose exec mysql bash -c 'mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" -e "select * from db.events" | sed "s/\t/,/g"' > events.csv