Project work environment setup
Set up the working environment for the project using Git and Docker
It is recommended that only one element of each group does this process and the others watch carefully to avoid git
conflicts.
Windows instructions
- Go to GitHub and create your new Git repository for the practical work.
- Clone the repository into a folder.
- In Windows you can clone to
C:\webdev
, to make it a shorter path without spaces, which sometimes complicates things - You may need to run the operation as an administrator, because it needs that to be able to write to the
C:\webdev
folder. In Windows, accessing the hard drive root requires admin rights.
- In Windows you can clone to
- Now double-click
C:\webdev
. It should be an empty folder. - Create a new folder inside
C:\webdev
calledhtml
. Download this file and place it inside the newly createdhtml
folder. - Open a command line (press Windows Key + R on your keyboard, then type
cmd.exe
and press Enter) - Type
cd C:\webdev
to go to the repository folder - Run
git status
on the command line to see if it really is a repository - See installation instructions here if you do not have Docker installed yet
- Run the command to start the HTTP Server powered by Docker
docker run -d -p 8080:8080 -it --name=php -v C:\webdev\html:/var/www/html quay.io/vesica/php73:dev
- Access your browser at http://localhost:8080. You should see a “Hello World!” page.
- If you edit the
C:\webdev\html\index.html
with Notepad and refresh the http://localhost:8080 page, it should change!
- If you edit the
- Commit and push your changes
- Run
git commit -a -m "My first commit!"
in the command line that you should still have open - Go to your GitHub repository on the GitHub website. You should see the new commit message.
Linux / Mac Instructions
- Go to GitHub and create your new Git repository for the practical work.
- Clone the repository into a folder.
- Now double-click the folder. It should be empty.
- Create a new folder inside the folder, called
html
. Download this file and place it inside the newly createdhtml
folder. - Open a command line
- Type
cd <folder>
to go to the folder, which is now a git repository - Run
git status
on the command line to see if it really is a repository - See installation instructions here if you do not have Docker installed yet
- Run the command to start the HTTP Server powered by Docker
1
docker run -d -p 8080:8080 -it --name=php -v $(pwd)/html/site:/var/www/html quay.io/vesica/php73:dev
- Access your browser at http://localhost:8080. You should see a “Hello World!” page.
- If you edit the
<folder>/html/index.html
with GEdit or atom and refresh the http://localhost:8080 page, it should change!
- If you edit the
- Commit and push your changes
- Run
git commit -a -m "My first commit!"
in the command line that you should still have open
- Run
- Go to your GitHub repository on the GitHub website. You should see the new commit message.
Reporting questions or problems
Questions or problems with this guide? Please contact the professors via email or in class.