|
1 |
| -ARG PHP_VERSION |
| 1 | +ARG PHP_VERSION=8.4.7 |
2 | 2 |
|
3 | 3 | FROM php:${PHP_VERSION}-cli
|
| 4 | + |
| 5 | +# Set environment variables |
| 6 | +ENV PATH="/usr/local/go/bin:${PATH}" \ |
| 7 | + COMPOSER_ALLOW_SUPERUSER=1 \ |
| 8 | + DEBIAN_FRONTEND=noninteractive |
| 9 | + |
| 10 | +# Install dependencies, Go, PHP extensions, and tools |
4 | 11 | RUN apt-get update \
|
5 |
| - && apt-get install -y \ |
| 12 | + && apt-get install -y --no-install-recommends \ |
6 | 13 | libzip-dev \
|
7 | 14 | unzip \
|
8 | 15 | git \
|
9 | 16 | wget \
|
| 17 | + curl \ |
| 18 | + tar \ |
| 19 | + gcc \ |
| 20 | + make \ |
| 21 | + ca-certificates \ |
| 22 | + build-essential \ |
| 23 | + pkg-config \ |
| 24 | + software-properties-common \ |
| 25 | + # Install Go 1.22.0 |
| 26 | + && curl -LO https://golang.org/dl/go1.22.0.linux-amd64.tar.gz \ |
| 27 | + && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz \ |
| 28 | + && rm go1.22.0.linux-amd64.tar.gz \ |
| 29 | + && ln -s /usr/local/go/bin/go /usr/bin/go \ |
| 30 | + # Install PHP extensions |
10 | 31 | && docker-php-ext-install -j$(nproc) bcmath sockets \
|
11 |
| - && wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \ |
12 |
| - && mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \ |
| 32 | + # Install CodeClimate Test Reporter |
| 33 | + && wget -O /usr/bin/cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \ |
13 | 34 | && chmod +x /usr/bin/cc-test-reporter \
|
| 35 | + # Install and enable Xdebug |
14 | 36 | && pecl install xdebug \
|
15 |
| - && docker-php-ext-enable xdebug && \ |
16 |
| - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
| 37 | + && docker-php-ext-enable xdebug \ |
| 38 | + # Install Composer |
| 39 | + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ |
| 40 | + # Cleanup |
| 41 | + && apt-get clean \ |
| 42 | + && rm -rf /var/lib/apt/lists/* |
17 | 43 |
|
| 44 | +# Set working directory |
18 | 45 | WORKDIR /opt/project
|
19 |
| - |
20 |
| - |
21 |
| - |
|
0 commit comments