FROM python:alpine3.19

WORKDIR /app

COPY . .
COPY crons_jobs /etc/cron.d/django_crons_jobs

RUN chmod 0644 /etc/cron.d/django_crons_jobs && crontab /etc/cron.d/django_crons_jobs && touch /var/log/cron.log



RUN apk update && apk add --no-cache mariadb-connector-c-dev && apk add --no-cache gcc musl-dev openrc
RUN pip install --no-cache-dir -r requirements.txt
RUN python manage.py makemigrations && python manage.py migrate


EXPOSE 8080

CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"]
#CMD ["./startup.sh"]

