Last active
April 28, 2020 09:01
-
-
Save Pintouch/507f91e5a3388622c8bed32548272303 to your computer and use it in GitHub Desktop.
Ofelia Scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from datetime import date | |
today = date.today() | |
print("Job executing... -> ", today) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
python3 job.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment