|
|
1 éve | |
|---|---|---|
| app | 1 éve | |
| docker | 1 éve | |
| .env-example | 1 éve | |
| README.md | 1 éve | |
| artisan.bat | 1 éve | |
| create-laravel-sample.bat | 1 éve | |
| docker-compose.yml | 1 éve | |
| set-laravel-permissions.bat | 1 éve |
Tyson Treasure 02/22/2024
02/23/24: Added XDebug support so you can live debug code on your local server! Also linked a few PHP config files so that they are easily updated. You can find these in the Docker/phpconfig folder.
Note: if you have cloned(downloaded to yor local) this project already, you will need to run a Git update in PHPStorm and
you will need to pull the latest image from our private Dockerhub. To do this simply type: docker compose pull. This will grab the latest image from DockerHub.
Then just type: Docker compose up -d as usual.
An interesting sidenote: The nice thing about Docker images is that they are built in layers. So when an image gets updated Docker doesn't need to pull the entire 200+MB image again, but only the new layers. Docker images also use compression to ease bandwidth usage.
To use:
start by installing Docker Desktop. from https://www.docker.com/products/docker-desktop/ Be sure to check the box that says use WSL... during install.
clone this project using PHPStorm. This can be done by going to open project from VCS from the main screen, or from the File menu. Make sure that Git is selected and that Git installed on your machine. If it isn't, PHPStorm should detect this and give you the option to install it. In the URL enter http://10.7.0.40/SRCLogistics/Docker-Local-Dev.git
Once it's cloned to your local PHPStorm, make sure you have Docker Desktop running, and open the terminal window in PHPStorm
type: docker compose up -d and press enter. This should download and configure everything for you. your web server html dir is in the app/public folder in your PHPStorm project. (Note: next time you run this command to bring up this server it will be faster.
you can now go to localhost in your browser, and you should see a test page.
You can access phpmyadmin at localhost:8000 the root password is 123. Remember this is in an isolated environment so simple password is fine to start. Before you place real live data in your DB though, you should change the password to something secure. It is always best practice to change the default password right away.
if you want to see a sample laravel project go back to you terminal and run create-laravel-sample.bat(this will take a while)
once complete, go back to localhost and you should see the larvel sample page.
to take your server down simply type: docker compose down in your terminal.
Note if you were using this server on a real project that you need to pull from Git you would first close this project, then open a new project from VCS using this project's App folder as the destination. You would never put an actual project inside of this PHPStorm project because any committed changes ' would be going to the Git repository for the local dev server project, and not the project you are working on.
After cloning a Laravel project into the app folder, you would need to run set-laravel-permissions.bat and create the database that your app uses by going to localhost:8000. Once the database is created, you can run artisan migrate to generate the tables for your project. Finally, you will need to copy the .env-example file from this project to the app folder of your cloned project and rename it .env Now you should be able to open localhost and see the project that you cloned.
As always if you need help feel free to send me a teams chat/call.