From 65d7c642bf036f5660bfd6ceec749d40ac65a3a2 Mon Sep 17 00:00:00 2001 From: Sergey Karmanov Date: Fri, 17 Mar 2023 15:50:23 +0300 Subject: [PATCH] Update docker settings --- Dockerfile | 13 ++++++------- README.md | 3 ++- crontab | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30270ed..a422d01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,17 @@ -FROM python:3.11.1-alpine3.17 +FROM python:3.11.2-alpine3.17 LABEL Maintainer="serega404" WORKDIR /app -COPY ./requirements.txt requirements.txt +COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt -COPY crontab /etc/cron.d/crontab -RUN chmod 0644 /etc/cron.d/crontab +# Setting up crontab +COPY crontab /tmp/crontab +RUN cat /tmp/crontab > /etc/crontabs/root COPY main.py main.py -RUN /usr/bin/crontab /etc/cron.d/crontab - # run crond as main process of container -CMD ["/usr/sbin/crond", "-f"] \ No newline at end of file +CMD ["crond", "-f", "-l", "2"] \ No newline at end of file diff --git a/README.md b/README.md index 11dd8c4..1c85f7f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MetricAliexpressExchangeRate -[![MIT License](https://img.shields.io/github/license/serega404/EasyESPRealy)](https://github.com/serega404/MetricAliexpressExchangeRate) +[![MIT License](https://img.shields.io/github/license/serega404/MetricAliexpressExchangeRate)](https://github.com/serega404/MetricAliexpressExchangeRate) Экспортер курса Aliexpress и ЦБ РФ @@ -35,6 +35,7 @@ docker run -d --name MetricAliexpressExchangeRate \ ### Библиотеки +* [Requests](https://requests.readthedocs.io/en/latest/) * [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) ### Лицензия diff --git a/crontab b/crontab index 94e2641..f36485c 100644 --- a/crontab +++ b/crontab @@ -1 +1,2 @@ -*/10 * * * * python3 /app/main.py >> /tmp/out.log +@reboot cd /app && python3 /app/main.py +*/10 * * * * cd /app && python3 /app/main.py