Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ DATA_FOLDER=./data
# Database configuration
DB_ROOT_PASSWORD=!mypassword!

UID=33
GID=33

# Service enablement (0 = disabled, 1 = enabled)
ENABLE_APACHE=1
ENABLE_NGINX=0
Expand Down
14 changes: 14 additions & 0 deletions build/php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ ARG XDEBUG_VERSION=3.4.1

FROM ${IMAGE}

ARG UID
ARG GID

RUN if [ "${GID}" != "33" -a "${UID}" != "33"]; \
then addgroup --gid ${GID} --system dockeruser && \
adduser --gid ${GID} --shell /bin/sh -u ${UID} dockeruser &&\
sed -i "s/user = www-data/user = dockeruser/g" /usr/local/etc/php-fpm.d/www.conf && \
sed -i "s/group = www-data/group = dockeruser/g" /usr/local/etc/php-fpm.d/www.conf; \
fi

ARG XDEBUG_VERSION

# Update packages list
Expand Down Expand Up @@ -46,3 +56,7 @@ docker-php-ext-install ldap
# Install @xdebug
RUN pecl install xdebug-${XDEBUG_VERSION} \
&& docker-php-ext-enable xdebug

USER ${UID}:${GID}

CMD ["php-fpm", "-y", "/usr/local/etc/php-fpm.conf", "-R"]
26 changes: 19 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ x-php-build: &default-php-build
args:
IMAGE: php:7.4-fpm
XDEBUG_VERSION: 3.1.6
UID: "${UID}"
GID: "${GID}"

# php template
x-php: &default-php
Expand All @@ -31,6 +33,8 @@ services:
args:
IMAGE: php:7.4-fpm
XDEBUG_VERSION: 3.1.6
UID: "${UID}"
GID: "${GID}"

php80:
<<: *default-php
Expand All @@ -40,6 +44,8 @@ services:
args:
IMAGE: php:8.0-fpm
XDEBUG_VERSION: 3.4.1
UID: "${UID}"
GID: "${GID}"

php81:
<<: *default-php
Expand All @@ -49,6 +55,8 @@ services:
args:
IMAGE: php:8.1-fpm
XDEBUG_VERSION: 3.4.1
UID: "${UID}"
GID: "${GID}"

php82:
<<: *default-php
Expand All @@ -58,6 +66,8 @@ services:
args:
IMAGE: php:8.2-fpm
XDEBUG_VERSION: 3.4.1
UID: "${UID}"
GID: "${GID}"

php83:
<<: *default-php
Expand All @@ -67,6 +77,8 @@ services:
args:
IMAGE: php:8.3-fpm
XDEBUG_VERSION: 3.4.1
UID: "${UID}"
GID: "${GID}"

php84:
<<: *default-php
Expand All @@ -76,9 +88,15 @@ services:
args:
IMAGE: php:8.4-fpm
XDEBUG_VERSION: 3.4.1
UID: "${UID}"
GID: "${GID}"

apache:
image: httpd:latest
user: "${UID}:${GID}"
environment:
APACHE_RUN_USER: "${UID}"
APACHE_RUN_GROUP: "${GID}"
ports:
- "${APACHE_PORT_88:-88}:88"
- "${APACHE_PORT_443:-443}:443"
Expand All @@ -93,6 +111,7 @@ services:
- ./conf/apache/httpd-vhosts.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf
- ./conf/certs:/etc/apache/certs
- ${HTML_FOLDER}:/var/www/html/
- ./apache2:/usr/local/apache2/logs
restart: always
# depends_on:
# - php74
Expand Down Expand Up @@ -120,13 +139,6 @@ services:
- ./conf/certs:/etc/nginx/certs
- ${HTML_FOLDER}:/var/www/html/
restart: always
# depends_on:
# - php74
# - php80
# - php81
# - php82
# - php83
# - php84
deploy:
replicas: ${ENABLE_NGINX:-0}

Expand Down