From a715b4946cd805a0f26aba557b721904696e8c66 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Tue, 10 Sep 2024 19:47:30 +0200 Subject: [PATCH 1/2] add health check --- docker-compose.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e154335..6dfbf75 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,6 +2,7 @@ version: "2" services: mariadb: image: mariadb:10 + container_name: my_mariadb expose: - 3306 volumes: @@ -10,17 +11,23 @@ services: environment: - MYSQL_DATABASE=${DATABASE_NAME} - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} + - MYSQL_ALLOW_EMPTY_ROOT_PASSWORD=yes restart: unless-stopped + healthcheck: + test: ["CMD", "healthcheck.sh", "--su-mysql", "--connect"] + timeout: 5s + retries: 10 backup: build: . image: fradelg/mysql-cron-backup depends_on: - - mariadb + mariadb: + condition: service_healthy volumes: - ${VOLUME_PATH}/backup:/backup environment: - - MYSQL_HOST=mariadb + - MYSQL_HOST=my_mariadb - MYSQL_USER=root - MYSQL_PASS=${MARIADB_ROOT_PASSWORD} - MAX_BACKUPS=1 From dac06953c32e804bf39f6599dc6fc14f4c123464 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Tue, 10 Sep 2024 19:52:19 +0200 Subject: [PATCH 2/2] do not mask docker username --- .github/workflows/image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index d1b827f..5827146 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -44,7 +44,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} + username: fradelg password: ${{ secrets.DOCKER_PASSWORD }} - name: Build multiarch image run: |