diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f1e6aa6..89dd5b3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,7 +25,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -35,7 +35,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub - if: github.event_name == 'push' + if: github.event_name == 'push' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -45,19 +45,19 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: alplat/dockflare + images: alplat/dockflare tags: | # For Git tags like v1.2.3 -> image tag 1.2.3 type=semver,pattern={{version}} # For Git tags like v1.2.3-beta.1 -> image tag 1.2.3-beta.1 type=semver,pattern={{version}},suffix=-{{premajor}}-{{prerelease}} - # For stable branch -> image tag 'latest' and 'stable' (if you want 'stable' too) - type=ref,event=branch,pattern=stable,value=latest - type=ref,event=branch,pattern=stable,value=stable # Optional: if you want an explicit 'stable' tag + # For stable branch -> image tag 'latest' and 'stable' + type=ref,event=branch,pattern=stable,value=latest + type=ref,event=branch,pattern=stable,value=stable # For unstable branch -> image tag 'unstable' type=ref,event=branch,pattern=unstable,value=unstable # For all pushes, create a SHA tag - type=sha,format=short + type=sha,format=short # Add a tag for the Git ref (branch name or tag name) itself type=ref,event=tag type=ref,event=branch @@ -67,7 +67,7 @@ jobs: uses: docker/build-push-action@v5 with: context: ./dockflare - platforms: ${{ (github.ref_name == 'unstable' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-'))) && 'linux/amd64' || 'linux/amd64,linux/arm64' }} + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name == 'push' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker-compose.yml b/docker-compose.yml index 12876cf..7447b95 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: '3.8' + services: docker-socket-proxy: image: tecnativa/docker-socket-proxy:v0.4.1 @@ -21,7 +22,6 @@ services: dockflare-init: image: alpine:3.20 - container_name: dockflare-init command: ["sh", "-c", "chown -R ${DOCKFLARE_UID:-65532}:${DOCKFLARE_GID:-65532} /app/data"] volumes: - dockflare_data:/app/data @@ -30,20 +30,22 @@ services: restart: "no" dockflare: - build: - context: ./dockflare - args: - DOCKFLARE_UID: ${DOCKFLARE_UID:-65532} - DOCKFLARE_GID: ${DOCKFLARE_GID:-65532} + image: alplat/dockflare:unstable container_name: dockflare restart: unless-stopped ports: - - "5001:5000" + - "5000:5000" + #labels: + # -- Cloudflare Tunnel Configuration (via DockFlare) OPTIONAL -- + #- dockflare.enable=true + #- dockflare.hostname=dockflare.domain.tld + #- dockflare.service=http://dockflare:5000 + #- dockflare.access.policy=default_tld volumes: - dockflare_data:/app/data - networks: - - cloudflare-net - - dockflare-internal + environment: + - REDIS_URL=redis://redis:6379/0 + - DOCKER_HOST=tcp://docker-socket-proxy:2375 depends_on: docker-socket-proxy: condition: service_started @@ -51,40 +53,27 @@ services: condition: service_completed_successfully redis: condition: service_started - environment: - - STATE_FILE_PATH=/app/data/state.json - - TZ=Europe/Zurich - - REDIS_URL=redis://redis:6379/0 - - CACHE_ENABLED=true - - DNS_RECORDS_CACHE_TIMEOUT=300 - - DOCKER_HOST=tcp://docker-socket-proxy:2375 - labels: - - dockflare.enable=true - - dockflare.hostname=master.dockflare.app - - dockflare.service=http://host.docker.internal:5001 - - dockflare.access.policy=bypass + networks: + - cloudflare-net + - dockflare-internal redis: image: redis:7-alpine container_name: dockflare-redis restart: unless-stopped + command: ["redis-server", "--save", "", "--appendonly", "no"] + volumes: + - dockflare_redis:/data networks: - dockflare-internal - volumes: - - redis-data:/data - healthcheck: - test: ["CMD", "redis-cli", "ping"] - interval: 10s - timeout: 5s - retries: 3 volumes: dockflare_data: - redis-data: + dockflare_redis: networks: cloudflare-net: name: cloudflare-net external: true dockflare-internal: - name: dockflare-internal + name: dockflare-internal \ No newline at end of file