Browse Source

Adds ofelia labels to schedule caniuse.js jobs. Updates the README, to provide an example ofelia job scheduler service.

master
Jonathan Rosenbaum 1 year ago
parent
commit
213305ff31
  1. 47
      README.md
  2. 7
      docker-compose.yml

47
README.md

@ -148,6 +148,53 @@ The commandline psql interacts with the database with 'strict' sql statements, s
Here's a good link to bring you up to speed with the power of psql: [https://phili.pe/posts/postgresql-on-the-command-line/](https://phili.pe/posts/postgresql-on-the-command-line/)
### Job Scheduler for caniuse.js
[Caniuse.js](caniuse.js) uses browserslist to query the caniuse-lite database. This is the substitute program for the now defunct Bumbleberry. Ofelia is used as an independent scheduler, and ofelia labels in [services](docker-compose.yml) establish the job requirements.
<details>
<summary>
```
docker-compose.yml for Ofelia job scheduler
```
</summary>
```
# This service provides ofelia, which is a job scheduler (cron).
#
# There should be at least on job in one of the services to make this
# meaningfull to run.
#
# It is accessible everywhere since it is bound to the docker socket.
# Cron jobs can be conveniently created with labels.
#
# https://github.com/mcuadros/ofelia
#
# When you add/change a cron job simply -
# docker compose down
# docker compose up -d
services:
ofelia:
container_name: ofelia
image: mcuadros/ofelia:latest
command: daemon --docker
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
```
</details>
### Production and Development mode
You may easily switch between the production and development environment in the .env file.

7
docker-compose.yml

@ -108,11 +108,16 @@ services:
- bikebikebike:/app/BikeBike
- bikebikebike_bundle:/usr/local/bundle
- bikebikebike_uploads:/app/BikeBike/public/uploads
build: .
expose:
- "3000"
links:
- db
labels:
ofelia.enabled: "true" # in rss2email
ofelia.job-exec.bikebike-job.schedule: "@every 6h"
ofelia.job-exec.bikebike-job.container: "bikebikebike"
ofelia.job-exec.bikebike-job.command: "/app/BikeBike/caniuse.js"
ofelia.job-exec.bikebike-job.user: "root:root"
restart: always
logging:
driver: "json-file"

Loading…
Cancel
Save