mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-17 03:03:57 +02:00
* add docker information
This commit is contained in:
26
_posts/01-07-01-Docker.md
Normal file
26
_posts/01-07-01-Docker.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
isChild: true
|
||||||
|
anchor: docker
|
||||||
|
---
|
||||||
|
|
||||||
|
## Docker {#docker_title}
|
||||||
|
|
||||||
|
Beside using Vagrant, another easy way to get a virtual development or production environment up and running is [Docker][docker].
|
||||||
|
Docker helps you to provide Linux containers for all kind of applications.
|
||||||
|
There are many helpful docker images that could provide you with other great services without the need to install
|
||||||
|
these services on your local machine, e.g. MySQL or PostgreSQL and a lot more.
|
||||||
|
Have a look at the [Docker Hub Registry][docker-hub] to search a list of available pre-built containers,
|
||||||
|
that you can then run and use in very few steps.
|
||||||
|
|
||||||
|
### Example: Runnning your PHP Applications in Docker
|
||||||
|
After you [installed docker][docker-install] on your machine, you can start an Apache with PHP support in one step.
|
||||||
|
The following command will download a fully functional Apache installation with the latest PHP version and provide the
|
||||||
|
directory `/path/to/your/php/files` at `http://localhost:8080`:
|
||||||
|
|
||||||
|
{% highlight bash %}
|
||||||
|
docker run -d --name my-php-webserver -p 8080:80 -v /path/to/your/php/files:/var/www/html/ php:apache
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
[docker]: http://docker.com/
|
||||||
|
[docker-hub]: https://registry.hub.docker.com/
|
||||||
|
[docker-install]: https://docs.docker.com/installation/
|
Reference in New Issue
Block a user