Skip to content

Commit 449a7e3

Browse files
committed
Merge branch 'php7dot4' of github.com:moveis-simonetti/php-apache-oci8-composer into php8dot0
2 parents 90a0491 + b95a60d commit 449a7e3

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

.github/workflows/docker-build.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 }}

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Container Base
22
FROM 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}
66
ENV NR_ENABLED=false
7+
ENV NR_DISTRIBUTED_TRACING_ENABLED=false
8+
ENV NR_APPLICATION_LOGGING_ENABLED=false
79
ENV NR_APP_NAME=""
810
ENV NR_LICENSE_KEY=""
911
ENV 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

3436
RUN 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

8890
COPY configs/ports.conf /etc/apache2/ports.conf
91+
COPY configs/headers.conf /etc/apache2/conf-enabled/headers.conf
8992
COPY configs/logs.conf /etc/apache2/conf-enabled/logs.conf
9093
COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
9194
COPY apache-run.sh /usr/bin/apache-run

bin/newrelic-setup

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
816
else
917
echo "newrelic.enabled = false" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
1018
fi

configs/headers.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Header append X-Request-UID "%{UNIQUE_ID}e"

0 commit comments

Comments
 (0)