- Open PowerShell
- Switch to WSL (Linux environment) by typing:
wsl - Go to the home directory:
cd ~ - Create a directory for the containers if there isn't one:
mkdir docker-containers - Move to the created directory:
cd docker-containers - Let's clone the git:
git clone https://github.com/TommiHAMK/web-development.git - Web-development directory is created. Go there:
cd web-development - Edit the .env file and set the MySQL password. MySQL username is root. Edit file:
nano .env,ctrl + xto exit. - Start Docker:
docker compose up -d
That's it! Now if you open Docker Desktop you should see the container.
- Running Linux (WSL) on Windows affects how files are created and edited
- Install "Dev Containers" VSC extension. It makes easier to edit files with VSC.
- How create a php or any text file? With PowerShell, navigate to web-development folder and type:
code .(Visual Studio Code opens). Now you can create and edit files using VSC. - You can copy images using Windows Explorer and even edit them using Photoshop or such.
- The path to web-development directory is
Linux\Ubuntu\home\<username>\docker-containers\web-development\
- Create your PHP & HTML files to public_html folder
- Wordpress is located in wordpress folder
- Username and password for Wordpress will be set during the installation process (open localhost:8080)
- MySQL username is root.
- Webroot: localhost:81
- phpMyAdmin: localhost:82
- Wordpress: localhost:8080
- If you use MySQL database in your PHP files, the address/host is just db
- PHP
- MySQL
- phpMyAdmin
- Wordpress