-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: create new container with cronjob tar-ing result daily
- Loading branch information
Showing
8 changed files
with
105 additions
and
19 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
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,14 @@ | ||
FROM registry.fedoraproject.org/fedora:38 | ||
MAINTAINER [email protected] | ||
|
||
RUN dnf -y update | ||
RUN dnf -y install cronie tar | ||
|
||
RUN touch /var/log/cron.log | ||
|
||
COPY files/cron/tar_persistent.sh /bin/tar_persistent | ||
RUN chmod +x /bin/tar_persistent | ||
|
||
COPY files/cron/crontab_daily /etc/cron.d/crontab_daily | ||
RUN chmod +x /etc/cron.d/crontab_daily | ||
RUN crontab /etc/cron.d/crontab_daily |
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,28 @@ | ||
FROM registry.fedoraproject.org/fedora:38 | ||
MAINTAINER [email protected] | ||
|
||
ENV ENV=production | ||
|
||
RUN dnf -y update | ||
RUN dnf -y install git | ||
|
||
RUN git clone https://github.com/fedora-copr/log-detective-website.git /src | ||
|
||
FROM registry.fedoraproject.org/fedora:38 | ||
MAINTAINER [email protected] | ||
|
||
ENV ENV=production | ||
|
||
RUN dnf -y update | ||
RUN dnf -y install cronie tar | ||
|
||
RUN touch /var/log/cron.log | ||
|
||
COPY --from=0 /src/files/cron/tar_persistent.sh /bin/tar_persistent | ||
RUN chmod +x /bin/tar_persistent | ||
|
||
COPY --from=0 /src/files/cron/crontab_daily /etc/cron.d/crontab_daily | ||
RUN chmod +x /etc/cron.d/crontab_daily | ||
RUN crontab /etc/cron.d/crontab_daily | ||
|
||
CMD ["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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
FROM registry.fedoraproject.org/fedora:38 | ||
MAINTAINER [email protected] | ||
|
||
ENV FEEDBACK_DIR=/persistent/results | ||
ENV ENV=production | ||
|
||
RUN dnf -y update && \ | ||
# Base packages | ||
dnf -y install htop \ | ||
make \ | ||
wget \ | ||
net-tools \ | ||
iputils \ | ||
vim \ | ||
mlocate \ | ||
jq \ | ||
fpaste \ | ||
git \ | ||
sudo \ | ||
python3-ipdb \ | ||
findutils \ | ||
dnf -y install git \ | ||
# Frontend | ||
&& dnf -y install \ | ||
npm \ | ||
|
@@ -36,7 +23,6 @@ RUN npx shadow-cljs release app | |
FROM registry.fedoraproject.org/fedora:38 | ||
MAINTAINER [email protected] | ||
|
||
ENV FEEDBACK_DIR=/persistent/results | ||
ENV ENV=production | ||
|
||
RUN dnf -y install python3-fastapi \ | ||
|
@@ -47,13 +33,25 @@ RUN dnf -y install python3-fastapi \ | |
python3-koji \ | ||
python3-copr \ | ||
koji \ | ||
htop \ | ||
btop \ | ||
make \ | ||
wget \ | ||
net-tools \ | ||
iputils \ | ||
vim \ | ||
mlocate \ | ||
jq \ | ||
fpaste \ | ||
git \ | ||
python3-ipdb \ | ||
findutils \ | ||
&& dnf clean all \ | ||
&& mkdir -p /src/{frontend,backend} | ||
|
||
COPY --from=0 /src/frontend/public /src/frontend/public | ||
COPY --from=0 /src/backend /src/backend | ||
|
||
# According to the documentation, gunicorn is a valid production server | ||
# https://www.uvicorn.org/deployment/ | ||
WORKDIR /src/backend | ||
ENV PYTHONPATH="${PYTHONPATH}:/src" | ||
|
||
|
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,5 @@ | ||
SHELL=/bin/bash | ||
PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
|
||
# run every day at 1:05AM | ||
5 1 * * * root tar_persistent >> /var/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/sh | ||
|
||
# archive results tar_persistent.sh and remove the old ones | ||
FILE_NAME=data-$(date +%s).tar.gz | ||
tar -czvf $STORAGE_DIR/new-$FILE_NAME -C $FEEDBACK_DIR . && \ | ||
rm -f $STORAGE_DIR/data-*.tar.gz && \ | ||
mv $STORAGE_DIR/new-$FILE_NAME $STORAGE_DIR/$FILE_NAME |
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,2 @@ | ||
STORAGE_DIR=/persistent | ||
FEEDBACK_DIR=/persistent/results |