sql y fastapi
This commit is contained in:
22
scrapper/Dockerfile
Normal file
22
scrapper/Dockerfile
Normal 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"]
|
Reference in New Issue
Block a user