File tree Expand file tree Collapse file tree 4 files changed +63
-4
lines changed Expand file tree Collapse file tree 4 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docker image
2+
3+ on :
4+ push :
5+ branches : ["master", "php*"]
6+
7+ jobs :
8+ push_to_registry :
9+ name : Push Docker image to Docker Hub
10+ runs-on : ubuntu-latest
11+
12+ permissions :
13+ packages : write
14+ contents : read
15+
16+ steps :
17+ - name : Check out the repo
18+ uses : actions/checkout@v4
19+
20+ - name : Log in to Docker Hub
21+ uses : docker/login-action@v3
22+ with :
23+ username : ${{ secrets.DOCKER_USERNAME }}
24+ password : ${{ secrets.DOCKER_PASSWORD }}
25+
26+ - name : Extract metadata (tags, labels) for Docker
27+ id : meta
28+ uses : docker/metadata-action@v5
29+ with :
30+ images : lojassimonetti/php-apache-oci8-composer
31+
32+ - name : Should push?
33+ id : shoudPush
34+ run : |
35+ if [[ ${{ github.event.ref }} =~ ^refs/heads/php[0-9]dot[0-9]$ ]]; then
36+ echo "match=true" >> $GITHUB_OUTPUT
37+ elif [[ ${{ github.event.ref }} = "refs/heads/master" ]]; then
38+ echo "match=true" >> $GITHUB_OUTPUT
39+ fi
40+
41+ - name : Build and push Docker image
42+ uses : docker/build-push-action@v5
43+ with :
44+ context : .
45+ push : ${{ steps.shoudPush.outputs.match == 'true' }}
46+ tags : ${{ steps.meta.outputs.tags }}
47+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 11# Container Base
22FROM php:8.0-apache
33
4- ENV http_proxy ${HTTP_PROXY}
5- ENV https_proxy ${HTTP_PROXY}
4+ ENV http_proxy= ${HTTP_PROXY}
5+ ENV https_proxy= ${HTTP_PROXY}
66ENV NR_ENABLED=false
7+ ENV NR_DISTRIBUTED_TRACING_ENABLED=false
8+ ENV NR_APPLICATION_LOGGING_ENABLED=false
79ENV NR_APP_NAME=""
810ENV NR_LICENSE_KEY=""
911ENV NR_VERSION=""
@@ -29,7 +31,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget vim superv
2931 sudo zlib1g zlib1g-dev libzip4 libzip-dev zip unzip librabbitmq-dev musl-dev && \
3032 rm -rf /var/lib/apt/lists/*
3133
32- RUN a2enmod rewrite unique_id
34+ RUN a2enmod rewrite unique_id headers
3335
3436RUN docker-php-ext-configure gd --with-jpeg \
3537 && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
@@ -86,6 +88,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/
8688 mkdir /var/www/.composer && chown -R www-data:www-data /var/www/.composer
8789
8890COPY configs/ports.conf /etc/apache2/ports.conf
91+ COPY configs/headers.conf /etc/apache2/conf-enabled/headers.conf
8992COPY configs/logs.conf /etc/apache2/conf-enabled/logs.conf
9093COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
9194COPY apache-run.sh /usr/bin/apache-run
Original file line number Diff line number Diff line change @@ -4,7 +4,15 @@ if [[ ${NR_ENABLED} == true ]]; then
44 sed -i -e " s/" REPLACE_WITH_REAL_KEY" /${NR_LICENSE_KEY} /g" /usr/local/etc/php/conf.d/newrelic.ini
55 sed -i -e " s/PHP Application/${NR_APP_NAME} /g" /usr/local/etc/php/conf.d/newrelic.ini
66 echo " newrelic.enabled = true" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
7- echo " newrelic.distributed_tracing_enabled = true" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
7+
8+ if [[ ${NR_DISTRIBUTED_TRACING_ENABLED} == true ]]; then
9+ echo " newrelic.distributed_tracing_enabled = true" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
10+ fi
11+
12+ if [[ ${NR_APPLICATION_LOGGING_ENABLED} == true ]]; then
13+ echo " newrelic.application_logging.enabled = true" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
14+ fi
15+
816else
917 echo " newrelic.enabled = false" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
1018fi
Original file line number Diff line number Diff line change 1+ Header append X-Request-UID "%{UNIQUE_ID}e"
You can’t perform that action at this time.
0 commit comments