Skip to content

Instantly share code, notes, and snippets.

@Pintouch
Last active April 28, 2020 09:01
Show Gist options
  • Save Pintouch/507f91e5a3388622c8bed32548272303 to your computer and use it in GitHub Desktop.
Save Pintouch/507f91e5a3388622c8bed32548272303 to your computer and use it in GitHub Desktop.
Ofelia Scheduler
version: "3"
services:
scheduler:
image: mcuadros/ofelia
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: ["daemon", "--docker"]
selenium_cron:
container_name: selenium_cron
build: .
command: ["tail", "-f", "/dev/null"]
depends_on:
- scheduler
labels:
ofelia.enabled: "true"
ofelia.job-exec.selenium_job.no-overlap: "true"
ofelia.job-exec.selenium_job.schedule: "@every 60s"
ofelia.job-exec.selenium_job.command: "./run-play.sh"
FROM joyzoursky/python-chromedriver:3.6-selenium
WORKDIR /usr/src/app
COPY install-selenium.sh play.py run-play.sh ./
RUN apt-get install unzip
RUN chmod u+rx install-selenium.sh
RUN chmod u+rx play.py
RUN chmod u+rx run-play.sh
RUN ./install-selenium.sh
RUN python3 -m pip install --upgrade pip
RUN pip3 install webdriver-manager
#!/usr/bin/python3
from datetime import date
today = date.today()
print("Job executing... -> ", today)
#!/bin/sh
python3 job.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment