-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): edit cron configuration
- Loading branch information
Showing
5 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
.vscode | ||
docker-compose.yml | ||
Dockerfile | ||
LICENSE | ||
logs | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
FROM python:3.9 | ||
|
||
# Install CRON | ||
RUN apt update && apt install -yqq cron | ||
COPY hello-cron /etc/cron.d/dynhostupdater | ||
RUN chmod 0644 /etc/cron.d/dynhostupdater | ||
RUN apt-get -qq update && apt-get install -yqq cron | ||
COPY config/cron.conf /etc/cron.d/dynhostupdater | ||
RUN chmod +x /etc/cron.d/dynhostupdater | ||
RUN crontab /etc/cron.d/dynhostupdater | ||
|
||
# Install application | ||
WORKDIR /app | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
RUN pip -q install -r requirements.txt | ||
COPY . . | ||
|
||
# Create default logs | ||
RUN mkdir -p logs | ||
RUN touch logs/lastest.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@reboot cd /app && python main.py > /dev/null 2>&1 | ||
*/15 * * * * root cd /app && python main.py > /dev/null 2>&1 | ||
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin | ||
|
||
@reboot root cd /app && python /app/main.py > /var/log/cron.log 2>&1 | ||
*/10 * * * * root cd /app && python /app/main.py > /dev/log/cron.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters