First, Make sure that Docker is installed on your machine by running the following command
docker -v
If you havn't install docker already - but i'm sure you did from the docker course days- the docker documentation provides an easy to follow steps to set up docker on your local machine.
For ubuntu users , here you'll find instructions to install it on your machine. Follow this guide
The installation method i personally prefer is Here
If you are using windows, as Dr. Noha always saying .. God bless your soul 😂 . you can install Docker Desktop from here Docker Desktop Installation
- Clone the demo repo, or the repo of your intake track
git clone https://github.com/NohaAShehab/os43-assuit-php.git
- cd into the directory
cd os43-assuit-php
- Inside the project directory, create a new file named Dockerfile.
touch Dockerfile
- open this file using your favourite text editor, i'm using vim but you can use VsCode or anything else.
vim Dockerfile
- paste the following two lines in the file
FROM php:7.4-apache
COPY . /var/www/html/
- Next, build the Docker image by running the following command from the project directory:
docker build -t php-day2-demos .
- Once the image is built, you can start a container from it by running the following command:
docker run -p 8080:80 php-day2-demos
and that's it! You can now access Day2 Demo application by visiting http://localhost:8080/validation/userstable.php in your web browser
Very impressive, dear Tarik. I liked the way you wrote the steps. They are straightforward to follow.
I want to thank you for your efforts, this will help us a lot while working on the PHP course and further projects.
Well done, Eng.Tarik.