File tree Expand file tree Collapse file tree 4 files changed +18
-24
lines changed Expand file tree Collapse file tree 4 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ FROM php:8.3.12-apache as final
5
5
6
6
# We're going to use this path multile times. So save it in a variable.
7
7
ARG UPLOADS_INI="/usr/local/etc/php/conf.d/uploads.ini"
8
- ARG XDEBUG_INI="/usr/local/etc/php/conf.d/xdebug.ini"
9
8
10
9
# enable Rewrites and setup mysqli, pdo, and xdebug
11
10
RUN a2enmod rewrite \
@@ -21,14 +20,6 @@ RUN a2enmod rewrite \
21
20
#
22
21
# Install and enable xdebug. Check PHP version compatibility! (https://xdebug.org/docs/compat#versions)
23
22
&& pecl install xdebug-3.4.1 \
24
- && docker-php-ext-enable xdebug \
25
- #
26
- # Move production php.ini and configure xdebug
27
- && { \
28
- echo "xdebug.mode = debug" ; \
29
- echo "xdebug.client_host = host.docker.internal" ; \
30
- echo "xdebug.start_with_request = trigger" ; \
31
- echo "xdebug.log = /dev/stdout" ; \
32
- } > ${XDEBUG_INI}
23
+ && docker-php-ext-enable xdebug
33
24
34
25
USER www-data
Original file line number Diff line number Diff line change 10
10
11
11
### create develop network
12
12
13
- Adapt ` .env ` to set the network name and than create the network if not already done
13
+ Adapt ` .env ` to set the project and network name and than create the network if not already done
14
14
15
15
``` sh
16
16
docker network create network-name-here
@@ -23,6 +23,8 @@ When you're ready, start your application by running:
23
23
24
24
## Setup xdebug launch.json
25
25
26
+ The ` xdebug.ini ` file sits in the root. After changing make sure to restart the webserver!
27
+
26
28
* Install xdebug extension
27
29
* create launch.json (open the xdebug tab and click "create a launch.json file" )
28
30
* add thist to the configurations section in the launnch.json file (for instance just below the port: 9003 section)
Original file line number Diff line number Diff line change 1
- # Comments are provided throughout this file to help you get started.
2
- # If you need more help, visit the Docker Compose reference guide at
3
- # https://docs.docker.com/go/compose-spec-reference/
4
1
5
- # Here the instructions define your application as a service called "server".
6
- # This service is built from the Dockerfile in the current directory.
7
- # You can add other services your application may depend on here, such as a
8
- # database or a cache. For examples, see the Awesome Compose repository:
9
- # https://github.com/docker/awesome-compose
10
- name : ${PROEJECT_NAME}
2
+ name : ${PROJECT_NAME}
11
3
networks :
12
4
default :
13
5
name : ${NETWORK_NAME}
14
6
15
7
services :
16
8
server :
17
- container_name : ${PROJECT_NAME}
9
+ container_name : ${PROJECT_NAME}-web
18
10
19
11
build :
20
12
context : .
13
+ restart : on-failure
21
14
ports : ["9080:80"]
22
- volumes : ["../htdocs/:/var/www/html"]
15
+ volumes :
16
+ - ../htdocs/:/var/www/html
17
+ - ../logs/:/var/www/logs
18
+ - ./xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
23
19
24
20
db :
25
21
container_name : ${PROJECT_NAME}-db
26
22
27
23
image : mariadb
28
- restart : always
24
+ volumes : ["./db/:/var/lib/mysql"]
25
+ restart : on-failure
29
26
ports : ["9306:3306"]
30
27
environment :
31
28
MARIADB_ROOT_PASSWORD : geheim
@@ -34,5 +31,5 @@ services:
34
31
container_name : ${PROJECT_NAME}-adminer
35
32
36
33
image : adminer
37
- restart : always
34
+ restart : on-failure
38
35
ports : ["9081:8080"]
Original file line number Diff line number Diff line change
1
+ xdebug.mode = debug
2
+ xdebug.client_host = host.docker.internal
3
+ xdebug.start_with_request = trigger
4
+ xdebug.log = /dev/stdout
You can’t perform that action at this time.
0 commit comments