From 3b1baf566fc664e0ac08199b2c2d12d637e222c2 Mon Sep 17 00:00:00 2001 From: Ben Yafai Date: Thu, 3 Oct 2024 23:07:45 +0100 Subject: [PATCH] Override the entrypoint so we can add a sleep delay before the next run. --- examples/docker-compose.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/docker-compose.yaml b/examples/docker-compose.yaml index 9f7abcb..e4e12ba 100644 --- a/examples/docker-compose.yaml +++ b/examples/docker-compose.yaml @@ -4,7 +4,8 @@ services: stdin_open: true tty: true image: ghcr.io/nanos/fedifetcher:latest - command: "--access-token= --server=" + # We override the Dockerfile entrypoint, run the python code with our commands, then append our sleep command. + entrypoint: ["sh", "-c", "python /app/find_posts.py --access-token= --server=; sleep 3600; "] # Persist our data volumes: - ./data:/app/artifacts @@ -14,6 +15,4 @@ services: replicas: 1 restart_policy: # The `any` condition means even after successful runs, we'll restart the script - condition: any - # Specify how often the script should run - for example; after 1 hour. - delay: 1h \ No newline at end of file + condition: any \ No newline at end of file