forked from kamba4/sunders
added dcrond for data replication
This commit is contained in:
parent
15ade89904
commit
fdd2862d5f
2 changed files with 34 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
|||
FROM ghcr.io/asohh/fedora-minimal-containers/php-cli:43
|
||||
RUN microdnf install -y php-mysqli php-bcmath php-xml gunzip && microdnf clean all
|
||||
RUN microdnf install -y php-mysqli php-bcmath php-xml gunzip https://raw.githubusercontent.com/rpmsphere/x86_64/master/d/dcron-4.5-7.1.x86_64.rpm && microdnf clean all
|
||||
COPY ./utils/* /opt/
|
||||
COPY ./data_init/*.sql /opt/init/init.sql
|
||||
|
||||
ENTRYPOINT ["/opt/entrypoint.sh"]
|
||||
|
||||
CMD ["/usr/sbin/dcrond", "-f" ]
|
29
utils/entrypoint.sh
Executable file
29
utils/entrypoint.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
|
||||
####################################################################################################
|
||||
### Crontab settings
|
||||
####################################################################################################
|
||||
|
||||
cat<<EOF | dcrontab -
|
||||
# min hour day month weekday command
|
||||
5 * * * * sh /opt/update_camera.sh
|
||||
EOF
|
||||
|
||||
####################################################################################################
|
||||
### Run prescripts
|
||||
####################################################################################################
|
||||
|
||||
php /opt/init_db.php
|
||||
#TODO add db_migrations
|
||||
echo "Prescripts done"
|
||||
|
||||
####################################################################################################
|
||||
### Run cmd
|
||||
####################################################################################################
|
||||
|
||||
# see: https://github.com/dubiousjim/dcron/issues/13
|
||||
# ignore using `exec` for `dcron` to get another pid instead of `1`
|
||||
# exec "$@"
|
||||
"$@"
|
Loading…
Add table
Add a link
Reference in a new issue