Skip to content

Commit 3daa9e6

Browse files
committed
Set cap_net_bind_service on apache2
1 parent 1b39ee7 commit 3daa9e6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
FROM php:7.4-apache
22

33
RUN apt-get update && \
4-
apt-get install -y libzip-dev tini && \
4+
apt-get install -y libcap2-bin tini libzip-dev && \
55
pecl install zip && \
66
docker-php-ext-configure pdo_mysql && \
77
docker-php-ext-install pdo_mysql && \
88
docker-php-ext-enable zip && \
99
rm -rf /var/lib/apt/lists/*
1010

11+
# Allow apache to bind to port 80 with any user
1112
# Use the PHP production settings.
1213
# Accept X-Forwarded-For as real client ip from a TRUSTED PROXY.
1314
# Set the "Server" header to production (e.g. to "Apache") and
1415
# remove apache version information. Build the ETAG from
1516
# last modified and size only.
16-
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
17+
RUN setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2 && \
18+
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
1719
a2enmod remoteip && \
1820
( \
1921
echo "RemoteIPHeader X-Forwarded-For" && \

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
- tsicons:/var/www/tsicons
2020
environment:
2121
#- INSTALL_MODE=1
22+
# Example: BASE_HREF for "https://foobar.com/frank/ranksystem" is "/frank/ranksystem/"
2223
- BASE_HREF=/
2324
- DB_TYPE=mysql
2425
- DB_HOST=ranksystem-db

0 commit comments

Comments
 (0)