Manual Steps

Manual Docker only — create code yourself, then build & run

This is the only way documented for this project.

You will:

  1. Create folders and every source file yourself (PHP or Node)
  2. Paste code from the linked files (or from the blocks below)
  3. Write a Dockerfile piece by piece
  4. docker pull images
  5. docker network create
  6. docker volume create (named volumes only — no host folder bind mounts)
  7. docker build (code goes into the image with COPY)
  8. docker run MySQL + app

You create .env + docker-compose.yml before running. Use manual docker run or docker compose up. There is no “mount ./application from the host”. Code is copied into the image at build time. Named volumes only hold MySQL data and uploaded files.


How code gets into the container

You create files on your PC
        ↓
Dockerfile: COPY application/ ...
        ↓
docker build   →  files baked into YOUR image
        ↓
docker run     →  container runs that image

Uploads / MySQL data use named volumes (created with docker volume create), not Windows folder mounts.


One-time: Docker in WSL

sudo service docker start
docker --version

If Docker is not installed yet, follow the install section in GUIDE.md (WSL + Docker Engine only).


Pick one stack

StackWorking folder you will createBrowserMySQL port
PHP~/docker-task-php (or any empty folder)http://localhost:80803306
Node~/assignment-docker-nodehttp://localhost:30003307

Reference copies of the finished code already live under:

Open those links in your editor if you prefer copy-from-file instead of paste-from-guide.


Manual Docker only — create code yourself, then build & run

This is the only way documented for this project.

You will:

  1. Create folders and every source file yourself (PHP or Node)
  2. Paste code from the linked files (or from the blocks below)
  3. Write a Dockerfile piece by piece
  4. docker pull images
  5. docker network create
  6. docker volume create (named volumes only — no host folder bind mounts)
  7. docker build (code goes into the image with COPY)
  8. docker run MySQL + app

You create .env + docker-compose.yml before running. Use manual docker run or docker compose up. There is no “mount ./application from the host”. Code is copied into the image at build time. Named volumes only hold MySQL data and uploaded files.


How code gets into the container

You create files on your PC
        ↓
Dockerfile: COPY application/ ...
        ↓
docker build   →  files baked into YOUR image
        ↓
docker run     →  container runs that image

Uploads / MySQL data use named volumes (created with docker volume create), not Windows folder mounts.


One-time: Docker in WSL

sudo service docker start
docker --version

If Docker is not installed yet, follow the install section in GUIDE.md (WSL + Docker Engine only).


Pick one stack

StackWorking folder you will createBrowserMySQL port
PHP~/docker-task-php (or any empty folder)http://localhost:80803306
Node~/assignment-docker-nodehttp://localhost:30003307

Reference copies of the finished code already live under:

Open those links in your editor if you prefer copy-from-file instead of paste-from-guide.


Go straight to: PHP manual → · Node.js manual →

Linked source files (quick index)

PHP — create these yourself

You createOpen / copy from
application/db.phpphp-app/application/db.php
application/style.cssphp-app/application/style.css
application/favorites.jsphp-app/application/favorites.js
application/index.phpphp-app/application/index.php
application/create.phpphp-app/application/create.php
application/edit.phpphp-app/application/edit.php
application/delete.phpphp-app/application/delete.php
application/favorites.phpphp-app/application/favorites.php
Dockerfilephp-app/Dockerfile

Node — create these yourself

You createOpen / copy from
package.jsonnodejs-app/package.json
application/server.jsnodejs-app/application/server.js
application/public/style.cssnodejs-app/application/public/style.css
Dockerfilenodejs-app/Dockerfile (manual version above uses npm install)

Database SQL

TaskFile
Create DB / user / tablesetup-database.html · setup.sql
Node init script (Compose auto-runs on a fresh MySQL volume)nodejs-app/database.sql

What you prove for the assignment

ConceptHow you prove it manually
Imagesdocker pull + docker images + your docker build image
DockerfileYou wrote it; COPY puts code in the image
Containersdocker run / docker ps / docker rm
Volumesdocker volume create + -v name:/path (not host bind mount)
Networkingdocker network create + --network-alias db + DB_HOST=db
PersistenceDelete containers, re-run with same volumes

Rules for this project (summary)

DoDon’t
Create every .php / .js file yourselfRely on compose as the main demo
COPY code in Dockerfile + docker buildBind-mount source code with -v ./app:...
docker volume create for MySQL + uploadsOnly use a host ./uploads folder as the “volume story”
docker pull then docker runHide everything behind one compose up

You are building, pulling, networking, and volumizing by hand. That is the whole point.