Skip to content

Commit

Permalink
added default docker-compose and switched build to tag based multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
geek-at committed Dec 7, 2024
1 parent 126f804 commit e839482
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 15 deletions.
68 changes: 53 additions & 15 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,59 @@
name: Publish Docker image
name: ci

on:
release:
types: [published]
push:
branches: [ master ]
tags:
- "v*.*.*"
pull_request:
branches: [ master ]
branches:
- "master"

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
docker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: docker build . --file docker/Dockerfile --tag hascheksolutions/backupdrop:$(date +%s) --tag hascheksolutions/backupdrop:latest
- name: Push the Docker image to the registry
run: docker push hascheksolutions/backupdrop
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
hascheksolutions/backupdrop
ghcr.io/hascheksolutions/backupdrop
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.8'

services:
backupdrop:
image: hascheksolutions/backupdrop
ports:
- "8080:80"
environment:
# remove unneeded config options
- ENCRYPTION_AGE_SSH_PUBKEY=
- ENCRYPTION_AGE_PUBKEY=
- S3_BUCKET=
- S3_ACCESS_KEY=
- S3_SECRET_KEY=
- S3_ENDPOINT=
- KEEP_N_BACKUPS=
- KEEP_N_DAYS=
- KEEP_N_GIGABYTES=
- FTP_SSL=
- FTP_SERVER=
- FTP_PORT=
- FTP_USER=
- FTP_PASS=
- FTP_BASEDIR=
restart: unless-stopped
volumes:
- ./data:/var/www/backupdrop/data

0 comments on commit e839482

Please sign in to comment.