Skip to content

Commit d58719b

Browse files
committed
feat(docker): add php-cs-fixer on docker
1 parent 0c9ba11 commit d58719b

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.docker/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
ARG PHP_VERSION
2+
3+
FROM alpine:3.19.1 as php-cs-fixer
4+
5+
RUN set -eux; \
6+
version=3.52.1; \
7+
\
8+
apk add --no-cache curl; \
9+
\
10+
curl -sSLfo /usr/local/bin/php-cs-fixer \
11+
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar; \
12+
\
13+
chmod +x /usr/local/bin/php-cs-fixer; \
14+
:;
15+
16+
217
FROM php:${PHP_VERSION}-cli
318

419
RUN docker-php-ext-install pdo
@@ -66,3 +81,5 @@ RUN set -eux; \
6681
\
6782
file /bin/ls --mime | grep application/x-executable; \
6883
:;
84+
85+
COPY --from=php-cs-fixer /usr/local/bin/php-cs-fixer /usr/local/bin/php-cs-fixer

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ Tests
8585
docker-compose down
8686

8787

88+
Lint
89+
----
90+
91+
test/bin/lint
92+
93+
8894
Documentation
8995
-------------
9096

test/bin/lint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/sh -eu
2+
3+
docker-compose up -d --build --remove-orphans php74 > /dev/null
4+
docker-compose exec php74 php-cs-fixer fix

0 commit comments

Comments
 (0)