mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-01-19 00:32:34 +01:00
Compare commits
7 commits
da8028abe5
...
8a403d725b
Author | SHA1 | Date | |
---|---|---|---|
|
8a403d725b | ||
|
dac06953c3 | ||
|
a715b4946c | ||
|
07213e8135 | ||
|
353430ff83 | ||
|
9f3f7bcdfa | ||
|
23cf857487 |
3 changed files with 15 additions and 9 deletions
12
.github/workflows/image.yml
vendored
12
.github/workflows/image.yml
vendored
|
@ -22,10 +22,10 @@ jobs:
|
||||||
DATABASE_NAME: foo
|
DATABASE_NAME: foo
|
||||||
MARIADB_ROOT_PASSWORD: abcd
|
MARIADB_ROOT_PASSWORD: abcd
|
||||||
run: |
|
run: |
|
||||||
docker-compose up -d mariadb
|
docker compose up -d mariadb
|
||||||
docker-compose run backup /backup.sh
|
docker compose run backup /backup.sh
|
||||||
docker-compose run backup /restore.sh /backup/latest.foo.sql.gz
|
docker compose run backup /restore.sh /backup/latest.foo.sql.gz
|
||||||
docker-compose stop
|
docker compose stop
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: test
|
needs: test
|
||||||
|
@ -44,10 +44,10 @@ jobs:
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: fradelg
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Build multiarch image
|
- name: Build multiarch image
|
||||||
run: |
|
run: |
|
||||||
docker buildx build --push \
|
docker buildx build --push \
|
||||||
--tag fradelg/mysql-cron-backup:${{ steps.docker-tag.outputs.tag }} \
|
--tag fradelg/mysql-cron-backup:${{ steps.docker-tag.outputs.tag }} \
|
||||||
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||||
|
|
|
@ -12,7 +12,7 @@ ENV GO111MODULE=on
|
||||||
RUN go mod tidy
|
RUN go mod tidy
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /go/bin/dockerize .
|
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /go/bin/dockerize .
|
||||||
|
|
||||||
FROM alpine:3.20.2
|
FROM alpine:3.20.3
|
||||||
LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>"
|
LABEL maintainer "Fco. Javier Delgado del Hoyo <frandelhoyo@gmail.com>"
|
||||||
|
|
||||||
RUN apk add --update \
|
RUN apk add --update \
|
||||||
|
|
|
@ -11,13 +11,19 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE=${DATABASE_NAME}
|
- MYSQL_DATABASE=${DATABASE_NAME}
|
||||||
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
||||||
|
- MYSQL_ALLOW_EMPTY_ROOT_PASSWORD=yes
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "healthcheck.sh", "--su-mysql", "--connect"]
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
backup:
|
backup:
|
||||||
build: .
|
build: .
|
||||||
image: fradelg/mysql-cron-backup
|
image: fradelg/mysql-cron-backup
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
mariadb:
|
||||||
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- ${VOLUME_PATH}/backup:/backup
|
- ${VOLUME_PATH}/backup:/backup
|
||||||
environment:
|
environment:
|
||||||
|
@ -30,4 +36,4 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
|
|
Loading…
Reference in a new issue