I'm using a docker-compose. I have a web and a worker service.
version: '3'
services:
web:
build: .
environment:
- "*"
links:
- redis
- memcached
ports:
- "80:8001"
- "443:8001"
worker:
build: .
command: ["/bin/bash", "/home/django/start_celery.sh"]
environment:
- "*"
links:
- redis
- memcached
memcached:
image: memcached
ports:
- "11211:11211"
redis:
image: redis
ports:
- "6379:6379"
I need to run crons (scheduled tasks) on worker service.
And I dont want to hardcode the crontab in Dockerfile as I'm using same dockerfile for both the services.
So what is the best approach for this?