startHere.txt
=============

✅ PURPOSE:
This guide walks you through how to build and run the PHP-based encryption/decryption environment in Docker.

📁 PROJECT STRUCTURE:
Place all the following files in a single folder (e.g., php-encrypt-env/):

    Dockerfile
    index.php
    Crypto_PW.php
    pwencryption.php
    pwdecryption.php

Make sure your Dockerfile has this content (already provided and correct):

    FROM php:7.4-apache
    COPY . /var/www/html/
    EXPOSE 80

🧱 STEP 1: Build the Docker Image

Open a terminal in this folder and run:

    docker build -t php-crypto .

🧪 STEP 2: Run the Docker Container

Run this to start the environment:

    docker run -d -p 8080:80 --name php-crypto-env php-crypto

Then visit in your browser:

    http://localhost:8080

🎯 STEP 3: Access Pages

You can test encryption/decryption by visiting:

    http://localhost:8080/index.php
    http://localhost:8080/pwencryption.php
    http://localhost:8080/pwdecryption.php

🔍 STEP 4: Debug or Inspect Container (Optional)

To check logs:

    docker logs php-crypto-env

To open a terminal inside the container:

    docker exec -it php-crypto-env bash

🛑 STEP 5: Stop or Remove the Container (Optional)

To stop:

    docker stop php-crypto-env

To remove:

    docker rm php-crypto-env

🧹 STEP 6: (Optional) Cleanup Docker Images

To list images:

    docker images

To remove an image:

    docker rmi php-crypto

💡 TIP:
Make sure your PHP files do not contain syntax errors before building the image. You can add `phpinfo();` to `index.php` for a sanity check.

---

📦 This file is your starting guide — keep it in your project root.


