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 1
1
# Container Base
2
2
FROM php:8.0-apache
3
3
4
- ENV http_proxy ${HTTP_PROXY}
5
- ENV https_proxy ${HTTP_PROXY}
4
+ ENV http_proxy= ${HTTP_PROXY}
5
+ ENV https_proxy= ${HTTP_PROXY}
6
6
ENV NR_ENABLED=false
7
+ ENV NR_DISTRIBUTED_TRACING_ENABLED=false
8
+ ENV NR_APPLICATION_LOGGING_ENABLED=false
7
9
ENV NR_APP_NAME=""
8
10
ENV NR_LICENSE_KEY=""
9
11
ENV NR_VERSION=""
@@ -29,7 +31,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget vim superv
29
31
sudo zlib1g zlib1g-dev libzip4 libzip-dev zip unzip librabbitmq-dev musl-dev && \
30
32
rm -rf /var/lib/apt/lists/*
31
33
32
- RUN a2enmod rewrite unique_id
34
+ RUN a2enmod rewrite unique_id headers
33
35
34
36
RUN docker-php-ext-configure gd --with-jpeg \
35
37
&& 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/
86
88
mkdir /var/www/.composer && chown -R www-data:www-data /var/www/.composer
87
89
88
90
COPY configs/ports.conf /etc/apache2/ports.conf
91
+ COPY configs/headers.conf /etc/apache2/conf-enabled/headers.conf
89
92
COPY configs/logs.conf /etc/apache2/conf-enabled/logs.conf
90
93
COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
91
94
COPY 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
4
4
sed -i -e " s/" REPLACE_WITH_REAL_KEY" /${NR_LICENSE_KEY} /g" /usr/local/etc/php/conf.d/newrelic.ini
5
5
sed -i -e " s/PHP Application/${NR_APP_NAME} /g" /usr/local/etc/php/conf.d/newrelic.ini
6
6
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
+
8
16
else
9
17
echo " newrelic.enabled = false" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
10
18
fi
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