mirror of
https://github.com/Tony0410/nextstep.git
synced 2026-05-24 21:31:43 +08:00
Add scheduler service for push notifications
This commit is contained in:
@@ -31,6 +31,24 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 40s
|
start_period: 40s
|
||||||
|
|
||||||
|
scheduler:
|
||||||
|
image: alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
app:
|
||||||
|
condition: service_healthy
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
command: >
|
||||||
|
-c "apk add --no-cache curl &&
|
||||||
|
while true; do
|
||||||
|
echo 'Triggering notification check...' &&
|
||||||
|
curl -s -X POST http://app:3000/api/notifications/send &&
|
||||||
|
echo '' &&
|
||||||
|
sleep 60;
|
||||||
|
done"
|
||||||
|
networks:
|
||||||
|
- nextstep-network
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: nextstep-db
|
container_name: nextstep-db
|
||||||
|
|||||||
Reference in New Issue
Block a user