Skip to content

Commit f9ab0bf

Browse files
authored
👷 docker support for OSS contributors (#34)
1 parent d93c5de commit f9ab0bf

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/.github export-ignore
22
/art export-ignore
3+
/docker export-ignore
34
/tests export-ignore
45
.gitattributes export-ignore
56
.gitignore export-ignore
67
CONTRIBUTING.md export-ignore
8+
docker-compose.yml export-ignore
79
LICENSE.md export-ignore
810
phpstan.neon.dist export-ignore
911
phpunit.xml.dist export-ignore

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,20 @@ Unit tests:
6666
```bash
6767
composer test:unit
6868
```
69+
70+
## Simplified setup using Docker
71+
72+
If you have Docker installed, you can quickly get all dependencies for jql-builder in place using Docker files. Assuming you have the repository cloned, you may run the following
73+
commands:
74+
75+
1. `docker compose build` to build the Docker image
76+
2. `docker compose run --rm composer install` to install Composer dependencies
77+
3. `docker compose run --rm composer test` to run the project tests and analysis tools
78+
79+
If you want to check things work against a specific version of PHP, you may include the `PHP` build argument when building the image:
80+
81+
```bash
82+
docker compose build --build-arg PHP=8.2
83+
```
84+
85+
The default PHP version will always be the lowest version of PHP supported by jql-builder.

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3.8"
2+
3+
services:
4+
php:
5+
build:
6+
context: ./docker
7+
volumes:
8+
- .:/var/www/html
9+
composer:
10+
build:
11+
context: ./docker
12+
volumes:
13+
- .:/var/www/html
14+
entrypoint: ["composer"]

docker/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG PHP=8.0
2+
FROM php:${PHP}-cli-alpine
3+
4+
RUN apk update \
5+
&& apk add zip libzip-dev icu-dev git
6+
7+
RUN docker-php-ext-configure zip
8+
RUN docker-php-ext-install zip
9+
RUN docker-php-ext-enable zip
10+
11+
RUN docker-php-ext-configure intl
12+
RUN docker-php-ext-install intl
13+
RUN docker-php-ext-enable intl
14+
15+
RUN apk add --no-cache $PHPIZE_DEPS linux-headers
16+
RUN pecl install pcov
17+
RUN docker-php-ext-enable pcov
18+
19+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
20+
21+
WORKDIR /var/www/html
22+
23+
ENTRYPOINT ["php"]

0 commit comments

Comments
 (0)