Hello everybody!
I’m trying to setup a cron job using django apscheduler, I have this working properly trough the command python manage.py runapscheduler, but I have the project in a docker container, and I can’t start the apscheduler with my container. Anyone who knows how to start the job in a container?
I’ve already tried in my dockerfile, but it’s not working
FROM python:3.11-alpine
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
ENV DEBUG=False
Abre a porta 8000 para acessar a aplicação (ajuste conforme necessário)
EXPOSE 3000
Comando para iniciar o servidor Django
CMD [“python”, “manage.py”, “makemigrations”, “–settings=app.settings.production”]
CMD [“python”, “manage.py”, “migrate”, “–settings=app.settings.production”]
CMD [“python”, “manage.py”, “runapscheduler”, “–settings=app.settings.production”]
CMD [“python”, “manage.py”, “runserver”, “0.0.0.0:3000”, “–settings=app.settings.production”]