000-default.conf
· 1.7 KiB · Text
Brut
<VirtualHost *:8080>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
ServerName localhost
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# <Directory "/var/www/html/public">
# DirectoryIndex index.php
# AllowOverride All
# Options FollowSymlinks
# Require all granted
# </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
| 1 | <VirtualHost *:8080> |
| 2 | # The ServerName directive sets the request scheme, hostname and port that |
| 3 | # the server uses to identify itself. This is used when creating |
| 4 | # redirection URLs. In the context of virtual hosts, the ServerName |
| 5 | # specifies what hostname must appear in the request's Host: header to |
| 6 | # match this virtual host. For the default virtual host (this file) this |
| 7 | # value is not decisive as it is used as a last resort host regardless. |
| 8 | # However, you must set it for any further virtual host explicitly. |
| 9 | #ServerName www.example.com |
| 10 | |
| 11 | ServerAdmin webmaster@localhost |
| 12 | DocumentRoot /var/www/html/public |
| 13 | ServerName localhost |
| 14 | |
| 15 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, |
| 16 | # error, crit, alert, emerg. |
| 17 | # It is also possible to configure the loglevel for particular |
| 18 | # modules, e.g. |
| 19 | #LogLevel info ssl:warn |
| 20 | |
| 21 | # <Directory "/var/www/html/public"> |
| 22 | # DirectoryIndex index.php |
| 23 | # AllowOverride All |
| 24 | # Options FollowSymlinks |
| 25 | # Require all granted |
| 26 | # </Directory> |
| 27 | |
| 28 | ErrorLog ${APACHE_LOG_DIR}/error.log |
| 29 | CustomLog ${APACHE_LOG_DIR}/access.log combined |
| 30 | |
| 31 | # For most configuration files from conf-available/, which are |
| 32 | # enabled or disabled at a global level, it is possible to |
| 33 | # include a line for only one particular virtual host. For example the |
| 34 | # following line enables the CGI configuration for this host only |
| 35 | # after it has been globally disabled with "a2disconf". |
| 36 | #Include conf-available/serve-cgi-bin.conf |
| 37 | </VirtualHost> |
Dockerfile
· 573 B · Docker
Brut
FROM mcr.microsoft.com/devcontainers/php:dev-8.4-apache-bullseye
# Install MariaDB client
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y mariadb-client postgresql-client libpq-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql pdo_pgsql
RUN a2enmod rewrite headers
RUN set -eux; \
XSO="$(find /usr/local/lib/php/extensions -type f -name 'xdebug*.so' -print -quit 2>/dev/null || true)"; \
if [ -n "$XSO" ]; then \
printf 'zend_extension="%s"\n' "$XSO" > /usr/local/etc/php/conf.d/zz-xdebug-auto.ini; \
fi
| 1 | FROM mcr.microsoft.com/devcontainers/php:dev-8.4-apache-bullseye |
| 2 | |
| 3 | # Install MariaDB client |
| 4 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
| 5 | && apt-get install -y mariadb-client postgresql-client libpq-dev |
| 6 | |
| 7 | RUN docker-php-ext-install mysqli pdo pdo_mysql pdo_pgsql |
| 8 | |
| 9 | RUN a2enmod rewrite headers |
| 10 | |
| 11 | RUN set -eux; \ |
| 12 | XSO="$(find /usr/local/lib/php/extensions -type f -name 'xdebug*.so' -print -quit 2>/dev/null || true)"; \ |
| 13 | if [ -n "$XSO" ]; then \ |
| 14 | printf 'zend_extension="%s"\n' "$XSO" > /usr/local/etc/php/conf.d/zz-xdebug-auto.ini; \ |
| 15 | fi |
devcontainer.json
· 1.3 KiB · JSON
Brut
{
"name": "Order System Backend",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"workspaceFolder": "/workspace",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"GitHub.copilot",
"xdebug.php-pack",
"junstyle.php-cs-fixer"
]
}
},
"forwardPorts": [
8080
],
"postCreateCommand": "git config oh-my-zsh.hide-info 1 && sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html && apache2ctl start",
"portsAttributes": {
"8080": {
"label": "PHP Artisan Serve",
"onAutoForward": "notify"
}
},
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/xdebug.ini,target=/usr/local/etc/php/conf.d/xdebug.ini,type=bind,consistency=cached",
"source=${localWorkspaceFolder}/.devcontainer/000-default.conf,target=/etc/apache2/sites-available/000-default.conf,type=bind,consistency=cached"
]
}
| 1 | { |
| 2 | "name": "Order System Backend", |
| 3 | "build": { |
| 4 | "dockerfile": "Dockerfile", |
| 5 | "context": ".." |
| 6 | }, |
| 7 | "workspaceFolder": "/workspace", |
| 8 | "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", |
| 9 | "features": { |
| 10 | "ghcr.io/devcontainers/features/common-utils:2": {}, |
| 11 | "ghcr.io/devcontainers/features/git:1": {} |
| 12 | }, |
| 13 | "customizations": { |
| 14 | "vscode": { |
| 15 | "settings": {}, |
| 16 | "extensions": [ |
| 17 | "GitHub.copilot", |
| 18 | "xdebug.php-pack", |
| 19 | "junstyle.php-cs-fixer" |
| 20 | ] |
| 21 | } |
| 22 | }, |
| 23 | "forwardPorts": [ |
| 24 | 8080 |
| 25 | ], |
| 26 | "postCreateCommand": "git config oh-my-zsh.hide-info 1 && sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html && apache2ctl start", |
| 27 | "portsAttributes": { |
| 28 | "8080": { |
| 29 | "label": "PHP Artisan Serve", |
| 30 | "onAutoForward": "notify" |
| 31 | } |
| 32 | }, |
| 33 | "mounts": [ |
| 34 | "source=${localWorkspaceFolder}/.devcontainer/xdebug.ini,target=/usr/local/etc/php/conf.d/xdebug.ini,type=bind,consistency=cached", |
| 35 | "source=${localWorkspaceFolder}/.devcontainer/000-default.conf,target=/etc/apache2/sites-available/000-default.conf,type=bind,consistency=cached" |
| 36 | ] |
| 37 | } |
xdebug.ini
· 76 B · INI
Brut
xdebug.mode = debug
xdebug.start_with_request = no
xdebug.client_port = 9000
| 1 | xdebug.mode = debug |
| 2 | xdebug.start_with_request = no |
| 3 | xdebug.client_port = 9000 |