diff --git a/.devcontainer/000-default.conf b/.devcontainer/000-default.conf new file mode 100644 index 0000000..1fa686c --- /dev/null +++ b/.devcontainer/000-default.conf @@ -0,0 +1,37 @@ + + # 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 + + # + # DirectoryIndex index.php + # AllowOverride All + # Options FollowSymlinks + # Require all granted + # + + 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 + \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1dbadc3..634f5c7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,4 +7,6 @@ RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/y RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y mariadb-client -RUN docker-php-ext-install mysqli pdo pdo_mysql \ No newline at end of file +RUN docker-php-ext-install mysqli pdo pdo_mysql + +RUN a2enmod rewrite headers \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 14cf49e..2205410 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,11 +21,11 @@ }, // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [ - 8000 + 80 ], "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", "portsAttributes": { - "8000": { + "80": { "label": "PHP Artisan Serve", "onAutoForward": "notify" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index d33a56c..2b5e599 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,6 +9,7 @@ services: volumes: - ../:/workspaces:cached - ./xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini + - ./000-default.conf:/etc/apache2/sites-available/000-default.conf # Overrides default command so things don't shut down after the process ends. command: sleep infinity diff --git a/README.md b/README.md index 5f2360b..a44fc39 100755 --- a/README.md +++ b/README.md @@ -50,6 +50,13 @@ also beginner will easily understand the flow and the structure of this applicat ``` +## DevContainer + + +```bash +apache2ctl start +``` + ## Docker Way This app can run inside docker with official support