diff --git a/.devcontainer/.env.devcontainer b/.devcontainer/.env.devcontainer new file mode 100644 index 00000000..ba3f020f --- /dev/null +++ b/.devcontainer/.env.devcontainer @@ -0,0 +1,45 @@ +APP_DEBUG=true +APP_ENV=development +APP_FALLBACK_LOCALE=en + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=blessingskin +DB_USERNAME=username +DB_PASSWORD=secret +DB_PREFIX= + +# Hash Algorithm for Passwords +# +# Available values: +# - BCRYPT, ARGON2I, PHP_PASSWORD_HASH +# - MD5, SALTED2MD5 +# - SHA256, SALTED2SHA256 +# - SHA512, SALTED2SHA512 +# +# New sites are *highly* recommended to use BCRYPT. +# +PWD_METHOD=BCRYPT +APP_KEY=base64:JaytOHG/JlLgulTVAhiS0tRqnAfCkQydbdP6VRmoAMY= + +MAIL_MAILER=smtp +MAIL_HOST= +MAIL_PORT=465 +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_ENCRYPTION= +MAIL_FROM_ADDRESS= +MAIL_FROM_NAME= + +CACHE_DRIVER=file +SESSION_DRIVER=file +QUEUE_CONNECTION=sync + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +PLUGINS_DIR=null +PLUGINS_URL=null diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index df6ad4fe..42f3384b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -14,6 +14,9 @@ RUN docker-php-ext-install mysqli pdo pdo_mysql gd zip ARG NODE_VERSION="none" RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi +# Enable Apache rewrite module +RUN a2enmod rewrite + # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends diff --git a/.devcontainer/blessing-skin.apache.conf b/.devcontainer/blessing-skin.apache.conf new file mode 100644 index 00000000..d36678df --- /dev/null +++ b/.devcontainer/blessing-skin.apache.conf @@ -0,0 +1,13 @@ +Listen 8080 + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + + + DocumentRoot /workspace/public + ErrorLog /workspace/storage/logs/apache-error.log + CustomLog /workspace/storage/logs/apache-access.log combined + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4119a0d0..1e0d4b7a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,30 +2,33 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/php-mariadb // Update the VARIANT arg in docker-compose.yml to pick a PHP version { - "name": "PHP & MariaDB (Community)", - "dockerComposeFile": "docker-compose.yml", - "service": "app", - "workspaceFolder": "/workspace", + "name": "PHP & MariaDB (Community)", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", - // Set *default* container specific settings.json values on container create. - "settings": { }, + // Set *default* container specific settings.json values on container create. + "settings": {}, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "xdebug.php-debug", - "bmewburn.vscode-intelephense-client", - "mrmlnc.vscode-apache" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "xdebug.php-debug", + "bmewburn.vscode-intelephense-client", + "mrmlnc.vscode-apache" + ], - // For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) - "forwardPorts": [8080, 3306], + // For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) + "forwardPorts": [8080, 3306], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "cp .env.example .env && sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)/public\" /var/www/html && composer install && yarn install", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "sudo truncate -s 0 /etc/apache2/ports.conf && sudo rm -f /etc/apache2/sites-enabled/000-default.conf && sudo ln -sf /workspace/.devcontainer/blessing-skin.apache.conf /etc/apache2/sites-enabled/ && ln -sf .devcontainer/.env.devcontainer .env && composer install && yarn install", - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "powershell": "latest" - } + // Start apache2 after the container is started + "postStartCommand": "apache2ctl start && echo '\\nšŸ‘‰ \\e[0;32mPlease run '\\'yarn build\\'' to build the frontend. Application is available on port 8080.\\e[0m šŸ‘ˆ\\n'", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "powershell": "latest" + } }