This docker image provides an environment to run old projects in PHP 4 on modern machines.
To set up the Docker environment for your system, follow these steps:
- Build the Docker image using the command:
docker build -f Dockerfile.alpine -t php4-apache2 .- Once the image is built, start the environment with the command:
docker run -d --restart unless-stopped --name php4 -p 80:80 -v $(pwd)/app:/usr/local/apache2/htdocs -v $(pwd)/conf:/usr/local/apache2/conf -v $(pwd)/apache_logs/:/usr/local/apache2/logs php4-apache2:latest-
Place project folders inside the 'app' directory. Virtual hosts can be configured within the 'conf/extra/httpd-vhosts.conf' file.
-
Access the container's shell with the command:
docker exec -it php4 shBy using the 'restart unless-stopped' command, the container will automatically restart if it stops for any reason. Additionally, the 'add-host' flag ensures that the connection to the production DB3 is always added to the '/etc/hosts' file.
