diff --git a/Dockerfile b/.docker/app/Dockerfile similarity index 81% rename from Dockerfile rename to .docker/app/Dockerfile index 811c5b6f8..e1e2e8112 100644 --- a/Dockerfile +++ b/.docker/app/Dockerfile @@ -1,15 +1,10 @@ -FROM php:7.3.6-fpm-alpine3.9 +FROM php:7.3.6-fpm-alpine3.9 as base RUN apk add --no-cache shadow openssl bash mysql-client nodejs npm git RUN docker-php-ext-install pdo pdo_mysql RUN touch /home/www-data/.bashrc | echo "PS1='\w\$ '" >> /home/www-data/.bashrc -ENV DOCKERIZE_VERSION v0.6.1 -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz - RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN usermod -u 1000 www-data @@ -21,3 +16,15 @@ RUN rm -rf /var/www/html && ln -s public html USER www-data EXPOSE 9000 + +FROM base as dev +USER root +ENV DOCKERIZE_VERSION v0.6.1 +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + +ADD .docker/app/.env /templates/.env +ADD .docker/app/entrypoint.sh /entrypoint.sh + +USER www-data diff --git a/.docker/entrypoint.sh b/.docker/app/entrypoint.sh similarity index 100% rename from .docker/entrypoint.sh rename to .docker/app/entrypoint.sh diff --git a/.gitignore b/.gitignore index fcdc9aff9..3b63f289a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,118 @@ -/node_modules -/public/hot -/public/storage -/storage/*.key -/vendor -.env -.env.backup -.phpunit.result.cache +www/node_modules +www/public/hot +www/public/storage +www/storage/*.key +www/vendor +www/.env +www/.env.backup +www/.phpunit.result.cache Homestead.json Homestead.yaml npm-debug.log yarn-error.log .docker/dbdata/ -.idea/ -.vscode/ .history/ .devcontainer/ + +# Created by https://www.toptal.com/developers/gitignore/api/phpstorm+all,code +# Edit at https://www.toptal.com/developers/gitignore?templates=phpstorm+all,code + +### Code ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +### PhpStorm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PhpStorm+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +# End of https://www.toptal.com/developers/gitignore/api/phpstorm+all,code + diff --git a/docker-compose.yaml b/docker-compose.yaml index 3891a6e14..c66dd4321 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,18 +1,21 @@ -version: '3' +version: "3.7" services: app: - build: . + build: + dockerfile: .docker/app/Dockerfile + context: . + target: dev container_name: micro-videos-app - entrypoint: dockerize -template ./.docker/app/.env:.env -wait tcp://db:3306 -timeout 40s ./.docker/entrypoint.sh + entrypoint: dockerize -template /templates/.env:.env -wait tcp://db:3306 -timeout 40s /entrypoint.sh environment: - _DB_HOST=db - _DB_DATABASE=code_micro_videos - _DB_USERNAME=root - _DB_PASSWORD=root volumes: - - .:/var/www + - ./www:/var/www networks: - app-network depends_on: @@ -27,7 +30,7 @@ services: ports: - "8000:80" volumes: - - .:/var/www + - ./www:/var/www networks: - app-network depends_on: diff --git a/.env.example b/www/.env.example similarity index 100% rename from .env.example rename to www/.env.example diff --git a/.styleci.yml b/www/.styleci.yml similarity index 100% rename from .styleci.yml rename to www/.styleci.yml diff --git a/app/Console/Kernel.php b/www/app/Console/Kernel.php similarity index 100% rename from app/Console/Kernel.php rename to www/app/Console/Kernel.php diff --git a/app/Exceptions/Handler.php b/www/app/Exceptions/Handler.php similarity index 100% rename from app/Exceptions/Handler.php rename to www/app/Exceptions/Handler.php diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/www/app/Http/Controllers/Auth/ForgotPasswordController.php similarity index 100% rename from app/Http/Controllers/Auth/ForgotPasswordController.php rename to www/app/Http/Controllers/Auth/ForgotPasswordController.php diff --git a/app/Http/Controllers/Auth/LoginController.php b/www/app/Http/Controllers/Auth/LoginController.php similarity index 100% rename from app/Http/Controllers/Auth/LoginController.php rename to www/app/Http/Controllers/Auth/LoginController.php diff --git a/app/Http/Controllers/Auth/RegisterController.php b/www/app/Http/Controllers/Auth/RegisterController.php similarity index 100% rename from app/Http/Controllers/Auth/RegisterController.php rename to www/app/Http/Controllers/Auth/RegisterController.php diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/www/app/Http/Controllers/Auth/ResetPasswordController.php similarity index 100% rename from app/Http/Controllers/Auth/ResetPasswordController.php rename to www/app/Http/Controllers/Auth/ResetPasswordController.php diff --git a/app/Http/Controllers/Auth/VerificationController.php b/www/app/Http/Controllers/Auth/VerificationController.php similarity index 100% rename from app/Http/Controllers/Auth/VerificationController.php rename to www/app/Http/Controllers/Auth/VerificationController.php diff --git a/app/Http/Controllers/Controller.php b/www/app/Http/Controllers/Controller.php similarity index 100% rename from app/Http/Controllers/Controller.php rename to www/app/Http/Controllers/Controller.php diff --git a/app/Http/Kernel.php b/www/app/Http/Kernel.php similarity index 100% rename from app/Http/Kernel.php rename to www/app/Http/Kernel.php diff --git a/app/Http/Middleware/Authenticate.php b/www/app/Http/Middleware/Authenticate.php similarity index 100% rename from app/Http/Middleware/Authenticate.php rename to www/app/Http/Middleware/Authenticate.php diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/www/app/Http/Middleware/CheckForMaintenanceMode.php similarity index 100% rename from app/Http/Middleware/CheckForMaintenanceMode.php rename to www/app/Http/Middleware/CheckForMaintenanceMode.php diff --git a/app/Http/Middleware/EncryptCookies.php b/www/app/Http/Middleware/EncryptCookies.php similarity index 100% rename from app/Http/Middleware/EncryptCookies.php rename to www/app/Http/Middleware/EncryptCookies.php diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/www/app/Http/Middleware/RedirectIfAuthenticated.php similarity index 100% rename from app/Http/Middleware/RedirectIfAuthenticated.php rename to www/app/Http/Middleware/RedirectIfAuthenticated.php diff --git a/app/Http/Middleware/TrimStrings.php b/www/app/Http/Middleware/TrimStrings.php similarity index 100% rename from app/Http/Middleware/TrimStrings.php rename to www/app/Http/Middleware/TrimStrings.php diff --git a/app/Http/Middleware/TrustProxies.php b/www/app/Http/Middleware/TrustProxies.php similarity index 100% rename from app/Http/Middleware/TrustProxies.php rename to www/app/Http/Middleware/TrustProxies.php diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/www/app/Http/Middleware/VerifyCsrfToken.php similarity index 100% rename from app/Http/Middleware/VerifyCsrfToken.php rename to www/app/Http/Middleware/VerifyCsrfToken.php diff --git a/app/Providers/AppServiceProvider.php b/www/app/Providers/AppServiceProvider.php similarity index 100% rename from app/Providers/AppServiceProvider.php rename to www/app/Providers/AppServiceProvider.php diff --git a/app/Providers/AuthServiceProvider.php b/www/app/Providers/AuthServiceProvider.php similarity index 100% rename from app/Providers/AuthServiceProvider.php rename to www/app/Providers/AuthServiceProvider.php diff --git a/app/Providers/BroadcastServiceProvider.php b/www/app/Providers/BroadcastServiceProvider.php similarity index 100% rename from app/Providers/BroadcastServiceProvider.php rename to www/app/Providers/BroadcastServiceProvider.php diff --git a/app/Providers/EventServiceProvider.php b/www/app/Providers/EventServiceProvider.php similarity index 100% rename from app/Providers/EventServiceProvider.php rename to www/app/Providers/EventServiceProvider.php diff --git a/app/Providers/RouteServiceProvider.php b/www/app/Providers/RouteServiceProvider.php similarity index 100% rename from app/Providers/RouteServiceProvider.php rename to www/app/Providers/RouteServiceProvider.php diff --git a/app/User.php b/www/app/User.php similarity index 100% rename from app/User.php rename to www/app/User.php diff --git a/artisan b/www/artisan similarity index 100% rename from artisan rename to www/artisan diff --git a/bootstrap/app.php b/www/bootstrap/app.php similarity index 100% rename from bootstrap/app.php rename to www/bootstrap/app.php diff --git a/bootstrap/cache/.gitignore b/www/bootstrap/cache/.gitignore similarity index 100% rename from bootstrap/cache/.gitignore rename to www/bootstrap/cache/.gitignore diff --git a/composer.json b/www/composer.json similarity index 96% rename from composer.json rename to www/composer.json index 34dadbefc..e9593b18e 100644 --- a/composer.json +++ b/www/composer.json @@ -37,8 +37,8 @@ "App\\": "app/" }, "classmap": [ - "database/seeds", - "database/factories" + "database/seeds", + "database/factories" ] }, "autoload-dev": { diff --git a/composer.lock b/www/composer.lock similarity index 100% rename from composer.lock rename to www/composer.lock diff --git a/config/app.php b/www/config/app.php similarity index 100% rename from config/app.php rename to www/config/app.php diff --git a/config/auth.php b/www/config/auth.php similarity index 100% rename from config/auth.php rename to www/config/auth.php diff --git a/config/broadcasting.php b/www/config/broadcasting.php similarity index 100% rename from config/broadcasting.php rename to www/config/broadcasting.php diff --git a/config/cache.php b/www/config/cache.php similarity index 100% rename from config/cache.php rename to www/config/cache.php diff --git a/config/database.php b/www/config/database.php similarity index 100% rename from config/database.php rename to www/config/database.php diff --git a/config/filesystems.php b/www/config/filesystems.php similarity index 100% rename from config/filesystems.php rename to www/config/filesystems.php diff --git a/config/hashing.php b/www/config/hashing.php similarity index 100% rename from config/hashing.php rename to www/config/hashing.php diff --git a/config/logging.php b/www/config/logging.php similarity index 100% rename from config/logging.php rename to www/config/logging.php diff --git a/config/mail.php b/www/config/mail.php similarity index 100% rename from config/mail.php rename to www/config/mail.php diff --git a/config/queue.php b/www/config/queue.php similarity index 100% rename from config/queue.php rename to www/config/queue.php diff --git a/config/services.php b/www/config/services.php similarity index 100% rename from config/services.php rename to www/config/services.php diff --git a/config/session.php b/www/config/session.php similarity index 100% rename from config/session.php rename to www/config/session.php diff --git a/config/view.php b/www/config/view.php similarity index 100% rename from config/view.php rename to www/config/view.php diff --git a/database/.gitignore b/www/database/.gitignore similarity index 100% rename from database/.gitignore rename to www/database/.gitignore diff --git a/database/factories/UserFactory.php b/www/database/factories/UserFactory.php similarity index 100% rename from database/factories/UserFactory.php rename to www/database/factories/UserFactory.php diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/www/database/migrations/2014_10_12_000000_create_users_table.php similarity index 100% rename from database/migrations/2014_10_12_000000_create_users_table.php rename to www/database/migrations/2014_10_12_000000_create_users_table.php diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/www/database/migrations/2014_10_12_100000_create_password_resets_table.php similarity index 100% rename from database/migrations/2014_10_12_100000_create_password_resets_table.php rename to www/database/migrations/2014_10_12_100000_create_password_resets_table.php diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/www/database/migrations/2019_08_19_000000_create_failed_jobs_table.php similarity index 100% rename from database/migrations/2019_08_19_000000_create_failed_jobs_table.php rename to www/database/migrations/2019_08_19_000000_create_failed_jobs_table.php diff --git a/database/seeds/DatabaseSeeder.php b/www/database/seeds/DatabaseSeeder.php similarity index 100% rename from database/seeds/DatabaseSeeder.php rename to www/database/seeds/DatabaseSeeder.php diff --git a/package.json b/www/package.json similarity index 100% rename from package.json rename to www/package.json diff --git a/phpunit.xml b/www/phpunit.xml similarity index 100% rename from phpunit.xml rename to www/phpunit.xml diff --git a/public/.htaccess b/www/public/.htaccess similarity index 100% rename from public/.htaccess rename to www/public/.htaccess diff --git a/public/favicon.ico b/www/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to www/public/favicon.ico diff --git a/public/index.php b/www/public/index.php similarity index 100% rename from public/index.php rename to www/public/index.php diff --git a/public/robots.txt b/www/public/robots.txt similarity index 100% rename from public/robots.txt rename to www/public/robots.txt diff --git a/resources/js/app.js b/www/resources/js/app.js similarity index 100% rename from resources/js/app.js rename to www/resources/js/app.js diff --git a/resources/js/bootstrap.js b/www/resources/js/bootstrap.js similarity index 100% rename from resources/js/bootstrap.js rename to www/resources/js/bootstrap.js diff --git a/resources/lang/en/auth.php b/www/resources/lang/en/auth.php similarity index 100% rename from resources/lang/en/auth.php rename to www/resources/lang/en/auth.php diff --git a/resources/lang/en/pagination.php b/www/resources/lang/en/pagination.php similarity index 100% rename from resources/lang/en/pagination.php rename to www/resources/lang/en/pagination.php diff --git a/resources/lang/en/passwords.php b/www/resources/lang/en/passwords.php similarity index 100% rename from resources/lang/en/passwords.php rename to www/resources/lang/en/passwords.php diff --git a/resources/lang/en/validation.php b/www/resources/lang/en/validation.php similarity index 100% rename from resources/lang/en/validation.php rename to www/resources/lang/en/validation.php diff --git a/resources/sass/app.scss b/www/resources/sass/app.scss similarity index 100% rename from resources/sass/app.scss rename to www/resources/sass/app.scss diff --git a/resources/views/welcome.blade.php b/www/resources/views/welcome.blade.php similarity index 100% rename from resources/views/welcome.blade.php rename to www/resources/views/welcome.blade.php diff --git a/routes/api.php b/www/routes/api.php similarity index 100% rename from routes/api.php rename to www/routes/api.php diff --git a/routes/channels.php b/www/routes/channels.php similarity index 100% rename from routes/channels.php rename to www/routes/channels.php diff --git a/routes/console.php b/www/routes/console.php similarity index 100% rename from routes/console.php rename to www/routes/console.php diff --git a/routes/web.php b/www/routes/web.php similarity index 100% rename from routes/web.php rename to www/routes/web.php diff --git a/server.php b/www/server.php similarity index 100% rename from server.php rename to www/server.php diff --git a/storage/app/.gitignore b/www/storage/app/.gitignore similarity index 100% rename from storage/app/.gitignore rename to www/storage/app/.gitignore diff --git a/storage/app/public/.gitignore b/www/storage/app/public/.gitignore similarity index 100% rename from storage/app/public/.gitignore rename to www/storage/app/public/.gitignore diff --git a/storage/framework/.gitignore b/www/storage/framework/.gitignore similarity index 100% rename from storage/framework/.gitignore rename to www/storage/framework/.gitignore diff --git a/storage/framework/cache/.gitignore b/www/storage/framework/cache/.gitignore similarity index 100% rename from storage/framework/cache/.gitignore rename to www/storage/framework/cache/.gitignore diff --git a/storage/framework/cache/data/.gitignore b/www/storage/framework/cache/data/.gitignore similarity index 100% rename from storage/framework/cache/data/.gitignore rename to www/storage/framework/cache/data/.gitignore diff --git a/storage/framework/sessions/.gitignore b/www/storage/framework/sessions/.gitignore similarity index 100% rename from storage/framework/sessions/.gitignore rename to www/storage/framework/sessions/.gitignore diff --git a/storage/framework/testing/.gitignore b/www/storage/framework/testing/.gitignore similarity index 100% rename from storage/framework/testing/.gitignore rename to www/storage/framework/testing/.gitignore diff --git a/storage/framework/views/.gitignore b/www/storage/framework/views/.gitignore similarity index 100% rename from storage/framework/views/.gitignore rename to www/storage/framework/views/.gitignore diff --git a/storage/logs/.gitignore b/www/storage/logs/.gitignore similarity index 100% rename from storage/logs/.gitignore rename to www/storage/logs/.gitignore diff --git a/tests/Bootstrap.php b/www/tests/Bootstrap.php similarity index 100% rename from tests/Bootstrap.php rename to www/tests/Bootstrap.php diff --git a/tests/CreatesApplication.php b/www/tests/CreatesApplication.php similarity index 100% rename from tests/CreatesApplication.php rename to www/tests/CreatesApplication.php diff --git a/tests/Feature/ExampleTest.php b/www/tests/Feature/ExampleTest.php similarity index 100% rename from tests/Feature/ExampleTest.php rename to www/tests/Feature/ExampleTest.php diff --git a/tests/TestCase.php b/www/tests/TestCase.php similarity index 100% rename from tests/TestCase.php rename to www/tests/TestCase.php diff --git a/tests/Unit/ExampleTest.php b/www/tests/Unit/ExampleTest.php similarity index 100% rename from tests/Unit/ExampleTest.php rename to www/tests/Unit/ExampleTest.php diff --git a/webpack.mix.js b/www/webpack.mix.js similarity index 100% rename from webpack.mix.js rename to www/webpack.mix.js diff --git a/yarn.lock b/www/yarn.lock similarity index 100% rename from yarn.lock rename to www/yarn.lock