-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdockerfile.sh
More file actions
executable file
·29 lines (21 loc) · 780 Bytes
/
dockerfile.sh
File metadata and controls
executable file
·29 lines (21 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
if [[ -z "$PHP_IMAGE" ]] ; then
PHP_IMAGE='php:8.2-cli'
fi
if [[ -z "$TNT_LISTEN_URI" ]]; then
TNT_LISTEN_URI='tarantool:3301'
fi
if [[ -n "$COVERAGE_FILE" ]]; then
RUN_CMDS="$RUN_CMDS && \\\\\n pecl install pcov && docker-php-ext-enable pcov"
fi
echo -e "
FROM $PHP_IMAGE
RUN apt-get update && \\
apt-get install -y curl git unzip${RUN_CMDS} && \\
git config --global --add safe.directory '*'
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENV PATH=~/.composer/vendor/bin:\$PATH
ENV TNT_LISTEN_URI=$TNT_LISTEN_URI
CMD if [ ! -f composer.lock ]; then composer install; fi && \\
vendor/bin/phpunit ${COVERAGE_FILE:+ --coverage-text --coverage-clover=}$COVERAGE_FILE
"