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
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

PROJECT_NAME=my_php7_project
PROJECT_BASE_URL=php.docker.localhost
#PROJECT_BASE_URL=localhost

DB_NAME=php
DB_USER=php
Expand Down Expand Up @@ -105,3 +106,6 @@ RSYSLOG_TAG=latest
WEBGRIND_TAG=1.5-1.9.5
OPENSMTPD_TAG=6.0-1.4.0
XHPROF_TAG=1.3.5

### XDEBUG
XDEBUG=noxdebug.ini
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.docker-sync/
.docker-sync/
jisc-collections-symfony
22 changes: 22 additions & 0 deletions containers/centos-php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM miveo/centos-php-fpm:7.2


RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum update -y
RUN ACCEPT_EULA=Y yum install -y msodbcsql mssql-tools unixODBC-devel
ADD install_sqlsrv.sh /root/install_sqlsrv.sh
ADD xdebug.sh /root/xdebug.sh

RUN /root/install_sqlsrv.sh

COPY xdebug.sh /usr/local/bin/
RUN ln -s usr/local/bin/xdebug.sh / # backwards compat
#ENTRYPOINT ["xdebug.sh"]
#CMD ["echo"]


# /opt/plesk/php/7.2/bin/pecl install pdo_sqlsrv
# echo "extension=pdo_sqlsrv.so" > /opt/plesk/php/7.2/etc/php.d/pdo_sqlsrv.ini
# /opt/plesk/php/7.2/bin/pecl install sqlsrv
# echo "extension=sqlsrv.so" > /opt/plesk/php/7.2/etc/php.d/sqlsrv.ini

1 change: 1 addition & 0 deletions containers/centos-php/additional-php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
memory_limit = 12800M
7 changes: 7 additions & 0 deletions containers/centos-php/install_sqlsrv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
yum-config-manager --enable remi-php72
yum install -y php72u-devel
yum install -y gcc
yum install -y gcc-c++
yum install -y pecl
pecl install pdo_sqlsrv
echo "extension=pdo_sqlsrv.so" > /etc/php.d/30-pdo_sqlsrv.ini
4 changes: 4 additions & 0 deletions containers/centos-php/noxdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;xdebug.remote_enable=on
;xdebug.remote_autostart=off
;xdebug.remote_host=10.254.254.254
;xdebug.remote_port=9000
5 changes: 5 additions & 0 deletions containers/centos-php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=on
xdebug.remote_autostart=off
xdebug.remote_host=10.254.254.254
xdebug.remote_port=9000
15 changes: 15 additions & 0 deletions containers/centos-php/xdebug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

if [ "X$XDEBUG_REMOTE_PORT" = "X" ] ; then
XDEBUG_REMOTE_PORT=9000
fi

if [ "X$XDEBUG" = "X1" ] ; then

echo "xdebug.remote_enable=on" > /etc/php.d/xdebug.ini
echo "xdebug.remote_autostart=off" >> /etc/php.d/xdebug.ini
echo "xdebug.remote_host=10.254.254.254" >> /etc/php.d/xdebug.ini
echo "xdebug.remote_port=$XDEBUG_REMOTE_PORT" >> /etc/php.d/xdebug.ini
fi
11 changes: 8 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ services:
# - /path/to/postgres/data/on/host:/var/lib/postgresql/data # I want to manage volumes manually.

php:
image: wodby/php:$PHP_TAG
#build: containers/centos-php
image: knesser/centos-php-fpm
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
Expand All @@ -37,6 +38,7 @@ services:
DB_NAME: $DB_NAME
PHP_FPM_USER: wodby
PHP_FPM_GROUP: wodby
XDEBUG: $XDEBUG
## Read instructions at https://wodby.com/stacks/php/docs/local/xdebug/
# PHP_XDEBUG: 1
# PHP_XDEBUG_DEFAULT_ENABLE: 1
Expand All @@ -46,7 +48,10 @@ services:
# PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS
# PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows
volumes:
- ./:/var/www/html
- ./jisc-collections-symfony:/var/www/html
- ./containers/centos-php/$XDEBUG:/etc/php.d/xdebug.ini
- ./containers/centos-php/additional-php.ini:/etc/opt/remi/php72/php.d/additional-php.ini
- ./containers/centos-php/additional-php.ini:/etc/php.d/additional-php.ini
## For macOS users (https://wodby.com/stacks/php/docs/local/docker-for-mac/)
# - ./:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
Expand All @@ -65,7 +70,7 @@ services:
NGINX_VHOST_PRESET: php
NGINX_SERVER_ROOT: /var/www/html/public
volumes:
- ./:/var/www/html
- ./jisc-collections-symfony:/var/www/html
# Options for macOS users (https://wodby.com/stacks/php/docs/local/docker-for-mac/)
# - ./:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
Expand Down