-
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.
Add docker-entrypoint.sh to deal with cron installation
- Loading branch information
Showing
9 changed files
with
56 additions
and
66 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
config/pre/*.env | ||
config/pro/*.env | ||
config/pre/crontabs/* | ||
config/pro/crontabs/* | ||
config/pre/cron.d/* | ||
config/pro/cron.d/* | ||
.env | ||
volumes |
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,16 +1,16 @@ | ||
FROM python:3.10-alpine | ||
|
||
# Installing a blank crontab for the user 'root' in the service | ||
RUN touch /etc/crontabs/root | ||
# Setting permissions to make the file writable only by the owner | ||
RUN chmod 0644 /etc/crontabs/root | ||
COPY ./docker-entrypoint.sh / | ||
|
||
# Fixing Python deps | ||
ADD requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
# Adding the app itself | ||
# Creating folders for the volumes | ||
RUN mkdir /data | ||
RUN mkdir /log | ||
|
||
# Adding the app itself | ||
ADD app /app | ||
WORKDIR /app | ||
ENTRYPOINT ["sh", "-c" , "crond -f"] | ||
ENTRYPOINT ["/docker-entrypoint.sh"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* * * * * python3 /app/run.py | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
echo "[*] Verifying permissions of the service crontab at '/etc/cron.d/service-crontab'…" | ||
chmod 644 /etc/cron.d/service-crontab | ||
echo "[*] Installing crontab from `/etc/cron.d/service-crontab`…" | ||
crontab /etc/cron.d/service-crontab | ||
echo "[*] Showing installed cron jobs…" | ||
crontab -l | ||
echo "[*] Starting cron daemon…" | ||
crond -f |
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