Created
August 26, 2019 17:18
-
-
Save willianbs/bcdd3f52f21deb94fb9707e6790ca7c4 to your computer and use it in GitHub Desktop.
Simple Docker Apache+PHP local dev in the current dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d -p 8082:80 --mount type=bind,source="$(pwd)",target=/var/www/html php:apache | |
// That's it! If you try this, and it works for you, you're done! | |
// The command does the following: | |
// If the Docker image php:apache is not present in your machine's local Docker registry, it will be downloaded from Docker hub. | |
// It creates a new container based on the image php:apache. | |
// It maps port 80 from the container to port 8082 on your host machine. | |
// It mounts the current directory from your host machine to /var/www/html in the container. | |
// If you're lucky, you can now access http://localhost:8082/ and see your web pages hosted from an Apache HTTP Server with PHP in a Docker container. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From: http://nelkinda.com/blog/apache-php-in-docker/