Skip to content
/ y-env Public

Docker Env for custom Laravel / Blade + WP CMS project

Notifications You must be signed in to change notification settings

enesyue/y-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bedrock + Sage (Blade) WordPress Local Development Environment on Windows with Docker & Docker Compose

Install docker https://docs.docker.com/get-docker/ Install WSL https://learn.microsoft.com/de-de/windows/wsl/install | https://learn.microsoft.com/de-de/windows/wsl/about

Setting up WSL:

  1. start Ubuntu bash / sh (or whatever linux dispo you've picked)
  2. sudo apt-get install
  3. install php8
  4. install composer
  5. install nodeJs
  6. install php-zip
  7. install 7z-zip

Setting up the local Docker Env:

  1. Create your project folder (for example: ykk-template)

  2. Download the files or clone the repo to your project folder

  3. Replace the 'env-files/.env.localdev' database variables and the 'WP_HOME'

  4. Replace the 'server-conf/nginx/nginx.conf' server_name with the same name you used on WP_HOME (without 'http://')

  5. Replace all the containers' names, and database variables in the docker-compose.yml file

  6. Use your terminal to cd into your project folder and run the command docker-compose --project-name your-project-name up -d --build

  7. Open the Docker Desktop UI to check all 4 containers are mounted and running

  8. On docker desktop open the php container cli via docker exec -it $id sh (or bash if WSL system differs from ubuntu) and run: 'composer create-project roots/bedrock' to create the Bedrock WordPress. Wait until the installation finishes.

  9. Edit your computer hosts file to add your new project server name so it will map to your application. The hosts file is a simple text file that contains any hostnames or domain names used in your local system. At the bottom of this file you should add the following lines:

    127.0.0.1 ykk-template.local 
    127.0.0.1 www.ykk-template.local 
    

    You will find it under 'C:\Windows\System32\drivers\etc' on Windows (open as administrator). './etc/hosts' on mac & linux.

  10. Now you can use any browser to access your application using http://ykk-template.local/. As the hostname is set up in your system and hosted in your system (inside a docker container) it is not published on the internet. Only your machine/system will be able to access this url.

  11. To access the website go to: http://ykk-template.local

  12. To access the WordPress admin got to: http://ykk-template.local/wp/wp-admin

  13. To access the PHPMyAdmin go to: http://ykk-template.local:8080

Containers/Services

The docker-compose.yml file will mount 4 containers/services:

  • DB (database)
  • PHP (PHP 8.1)
  • NGinx (server)
  • PHPMyAdmin (for managing the database)

About

Docker Env for custom Laravel / Blade + WP CMS project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published