Skip to content

Commit a9e36d5

Browse files
authored
Merge pull request #32 from joanhey/docker-apache
Add apache dockerfile
2 parents e2c81eb + 3fdaadb commit a9e36d5

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.docker/apache.dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM php:8.2-apache
2+
3+
RUN apt-get update \
4+
&& apt-get install -y libicu-dev
5+
6+
RUN mkdir /var/www/html/PHP-Frameworks-Bench
7+
8+
# Need it in a lot of frameworks
9+
RUN docker-php-ext-install intl
10+
11+
# Optional opcache (recommended)
12+
#RUN docker-php-ext-install opcache
13+
14+
ENV PORT 80
15+
ENTRYPOINT []
16+
CMD sed -i "s/80/$PORT/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf && docker-php-entrypoint apache2-foreground

apache.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
if [ ! `which docker` ]; then
4+
echo "docker not found."
5+
exit 1;
6+
fi
7+
8+
PORT=${1:-8080}
9+
10+
docker build --tag bench/apache -f .docker/apache.dockerfile .
11+
12+
echo "Runing apache in http://127.0.0.1:$PORT"
13+
echo -e "Press Ctrl+C to stop. \n\n"
14+
15+
docker run -it --net=host -e PORT="$PORT" -v "$PWD":/var/www/html/PHP-Frameworks-Bench:rw bench/apache:latest

base/_functions.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ benchmark () {
4040

4141
rps=`grep "Requests/sec:" "$output_wrk" | tr -cd '0-9.'`
4242

43-
echo "rps: "
44-
numfmt --g "$rps"
43+
echo "rps: $rps"
4544

4645
# to make a small gap between the WRK and CURL
4746
sleep 1

0 commit comments

Comments
 (0)