diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index f15af8cec..6a2d1822e 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -4,9 +4,18 @@ RUN a2enmod rewrite # install needed libraries RUN apt-get update \ && apt-get -y --no-install-recommends install libfontconfig1 libxrender1 libxext6 zlib1g-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev \ + && apt-get -y --no-install-recommends install build-essential autoconf \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # PHP extensions RUN docker-php-ext-install pdo_mysql exif gd # Enable xdebug for debugging & profiling -RUN pecl install xdebug-3.3.1 && docker-php-ext-enable xdebug gd \ No newline at end of file +RUN cd /tmp && \ + curl -L --insecure https://github.com/xdebug/xdebug/archive/3.3.1.tar.gz | tar xz && \ + cd xdebug-3.3.1 && \ + phpize && \ + ./configure --enable-xdebug && \ + make && \ + make install && \ + docker-php-ext-enable xdebug && \ + cd / && rm -rf /tmp/xdebug-3.3.1 \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 000000000..8a1d5460c --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,55 @@ +name: Build and Push Docker Image + +on: + workflow_dispatch: + pull_request: + branches: + - master + +env: + REGISTRY: docker.io + IMAGE_NAME: dropapp + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: .docker/php + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file