ops: add restart unless-stopped to compose services; doc daily restart via cron/launchd
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
colin 2025-08-27 18:54:26 -04:00
parent 26ef65438e
commit 361f3c8b63
3 changed files with 16 additions and 0 deletions

View File

@ -145,6 +145,16 @@ docker-compose up
The application will be available at http://localhost:5001.
### Daily restarts (optional)
Docker Compose does not support time-based restarts. To force a daily restart:
- Cron (Linux):
- Example: restart at 3:15 AM daily
- `15 3 * * * cd /Users/computerpro/dev/ploughshares && /usr/local/bin/docker-compose down && /usr/local/bin/docker-compose up -d`
- launchd (macOS): create `~/Library/LaunchAgents/com.ploughshares.dailyrestart.plist` with a StartCalendarInterval and run a script that executes `docker-compose -f docker-compose.yml down && docker-compose -f docker-compose.yml up -d` in the repo directory.
### Crawler - Google Alerts
To run the Google Alerts crawler locally (requires GOOGLE_API_KEY):

View File

@ -28,6 +28,7 @@ services:
volumes:
- ./docker/ploughshares:/app
- ./docker/ploughshares/uploads:/app/uploads
restart: unless-stopped
db:
image: postgres:12
@ -45,6 +46,7 @@ services:
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
crawler_google_alerts:
build:
@ -58,6 +60,7 @@ services:
command: python main.py
volumes:
- ./docker/crawler-google-alerts:/app
restart: unless-stopped
volumes:
postgres_dev_data:

View File

@ -22,6 +22,7 @@ services:
condition: service_healthy
volumes:
- ./docker/ploughshares/uploads:/app/uploads
restart: unless-stopped
db:
image: postgres:12
@ -37,6 +38,7 @@ services:
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
crawler_google_alerts:
build:
@ -48,6 +50,7 @@ services:
db:
condition: service_started
command: python main.py
restart: unless-stopped
volumes:
postgres_data: