浏览代码

fixed some issues, added xdebug

master
Daniel 3 年前
父节点
当前提交
daa6ea8f9c
共有 3 个文件被更改,包括 31 次插入1 次删除
  1. +13
    -0
      Dockerfile
  2. +16
    -0
      README.md
  3. +2
    -1
      docker-compose.yml

+ 13
- 0
Dockerfile 查看文件

@@ -19,6 +19,19 @@ RUN apt-get install -y \

RUN apt-get install -y git zip

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host = host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.discover_client_host=1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.log=/var/www/var/log/xdebug.log' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.log_level=0' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# && echo 'xdebug.client_port=9003' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
# && echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
# && echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
# && echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \

COPY .docker/contao/install_composer.sh /install_composer.sh

RUN chmod +x /install_composer.sh \


+ 16
- 0
README.md 查看文件

@@ -21,7 +21,23 @@
- NOTE: the 'host' isn't 'localhost' here, use the name of the database service 'database' as it's configured in
the docker-compose.yml
- Finish the installation and have fun :)
- NOTE: For full installation you have to wait until composer is fully done with installation if you install
the project for the first time (or setting it up freshly). If you use Docker Desktop you can go to "Containers"
and click on the container named "contao". Then you'll see the console output of this container and wait until it's
done to ensure the project is running properly.
- Contao will be available here: [http://localhost/contao](http://localhost/contao)
- XDebug:
- Xdebug is also available within this project. If you'd like to use it do the following in PHPStorm:
1. Go to Preferences->PHP
2. Click on "..."-button at CLI Interpreter
3. A new window for CLI Interpreters will pop up
4. Click on "+" in order to add a new CLI interpreter
5. Select "From Docker, Vagrant, VM, WSL, Remote..."
6. A new window will pop up and select radiobutton "Docker" (should be selected by default) here and then select
the docker image, which is "php-apache-contao:latest" in this case
7. After selection the PHP version will be displayed and also the XDebug version
8. Actually you're done, but you should set the "PHP language level" on the first screen on the same PHP Version
as your CLI Interpreter to make sure that PHPStorm helps you with your very PHP version :)

# Some important information
- The database content is stored in a container which is bind-mounted to the 'db'-folder of the project


+ 2
- 1
docker-compose.yml 查看文件

@@ -9,12 +9,13 @@ services:
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- ./../.db:/var/lib/mysql
- ./.db:/var/lib/mysql
networks:
- default
contao:
build:
dockerfile: ./Dockerfile
image: php-apache-contao
container_name: contao
ports:
- "80:80"


正在加载...
取消
保存