mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-07-22 19:47:51 +00:00
user docker compose run and cmd instead entrypoint
This commit is contained in:
parent
c690088380
commit
73c2c0248b
4 changed files with 7 additions and 4 deletions
6
.github/workflows/image.yml
vendored
6
.github/workflows/image.yml
vendored
|
@ -21,7 +21,11 @@ jobs:
|
||||||
VOLUME_PATH: /tmp/mariadb
|
VOLUME_PATH: /tmp/mariadb
|
||||||
DATABASE_NAME: foo
|
DATABASE_NAME: foo
|
||||||
MARIADB_ROOT_PASSWORD: abcd
|
MARIADB_ROOT_PASSWORD: abcd
|
||||||
run: docker compose up --build
|
run: |
|
||||||
|
docker-compose up -d mariadb
|
||||||
|
docker-compose run backup /backup.sh
|
||||||
|
docker-compose run backup /restore.sh /backup/latest.foo.sql.gz
|
||||||
|
docker-compose stop
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: test
|
needs: test
|
||||||
|
|
|
@ -44,5 +44,4 @@ VOLUME ["/backup"]
|
||||||
HEALTHCHECK --interval=2s --retries=1800 \
|
HEALTHCHECK --interval=2s --retries=1800 \
|
||||||
CMD stat /HEALTHY.status || exit 1
|
CMD stat /HEALTHY.status || exit 1
|
||||||
|
|
||||||
ENTRYPOINT dockerize -wait tcp://${MYSQL_HOST}:${MYSQL_PORT} -timeout ${TIMEOUT}
|
CMD dockerize -wait tcp://${MYSQL_HOST}:${MYSQL_PORT} -timeout ${TIMEOUT} /run.sh
|
||||||
CMD [ "/run.sh" ]
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ services:
|
||||||
backup:
|
backup:
|
||||||
build: .
|
build: .
|
||||||
image: fradelg/mysql-cron-backup
|
image: fradelg/mysql-cron-backup
|
||||||
command: /backup.sh
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
if [ "$#" -ne 1 ]
|
if [ "$#" -ne 1 ]
|
||||||
then
|
then
|
||||||
echo "You must pass the path of the backup file to restore"
|
echo "You must pass the path of the backup file to restore"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue