sql y fastapi

This commit is contained in:
Your Name
2025-02-07 23:21:09 +01:00
parent 85228eeda9
commit 8e0faee3dd
14 changed files with 120 additions and 53 deletions

22
scrapper/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM python:latest
RUN apt-get update && apt-get install -y cron
WORKDIR ./
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Copia el archivo crontab al contenedor
COPY crontab.txt /etc/cron.d/my_cron_job
# Asigna los permisos adecuados
RUN chmod 0644 /etc/cron.d/my_cron_job
# Asegura que el archivo se procese por cron
RUN touch /var/log/cron.log && chmod 0666 /var/log/cron.log
CMD ["sh", "-c", "cron -f"]
CMD ["python", "./webscrapper.py"]