Skip to content

Commit

Permalink
Adjusted path in Dockerfile, Changed branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Giesenow committed Dec 19, 2023
1 parent 9646993 commit ae2c8d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags:
- "v*.*.*"
branches:
- "main"
- "master"

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}
tags: |
type=edge,branch=main,suffix=${{ matrix.php-suffix }}
type=edge,branch=master,suffix=${{ matrix.php-suffix }}
type=semver,pattern={{version}},suffix=${{ matrix.php-suffix }}
type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.php-suffix }}
type=semver,pattern={{major}},suffix=${{ matrix.php-suffix }}
Expand Down
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION} as base
COPY --from=composer/composer:2-bin /composer /usr/local/bin/composer

FROM base as vendor
WORKDIR /var/www
COPY composer.json /var/www/composer.json
COPY composer.json /fixer/composer.json
WORKDIR /fixer
RUN composer install --prefer-dist --no-dev --optimize-autoloader --no-scripts

FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION} as dist
WORKDIR /var/www
RUN rmdir /var/www/html
COPY src /usr/local/bin/src
COPY php-cs-fixer /usr/local/bin/php-cs-fixer
RUN mkdir /code
WORKDIR /code
COPY src /fixer/src
COPY php-cs-fixer /fixer/php-cs-fixer
# Only take the dependencies (not composer itself) into the container
COPY --from=vendor /var/www/vendor /usr/local/bin/vendor
COPY --from=vendor /fixer/vendor /fixer/vendor
RUN ln -s /fixer/php-cs-fixer /usr/local/bin/php-cs-fixer
ENTRYPOINT ["/usr/local/bin/php-cs-fixer"]

FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION} as dev
FROM base as dev
ARG DOCKER_USER_ID
ARG DOCKER_GROUP_ID
ARG PHP_XDEBUG_VERSION
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ projects. This tool does not only detect them, but also fixes them for you.
You can take a ready built docker image to run ``php-cs-fixer``.

```console
docker run -v $(pwd):/var/www ghcr.io/php-cs-fixer/php-cs-fixer:latest fix src
docker run -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:latest fix src
```

or integrate as check into Gitlab CI like this:
Expand Down

0 comments on commit ae2c8d0

Please sign in to comment.