PHP Web Development Environment based on Docker, by FEROX
Provides a modern web development environment for PHP developpers based on Docker. It features:
- Be sure to have Docker & docker-compose installed
git clone https://github.com/frxyt/webdevenv-php
cd webdevenv-php
docker network create webdevenv
docker-compose up -d
You need to resolve *.localhost
domains to 127.0.0.1
, unfortunately, the good old dnsmasq
doesn't work out-of-the-box now because of systemd
, here are some steps to make it working:
-
sudo apt-get install dnsmasq
-
sudo sed -i 's/^#\?DNS=.*$/DNS=127.0.0.53/' /etc/systemd/resolved.conf
-
sudo sed -i 's/^#\?listen-address=.*$/listen-address=127.0.0.53/' /etc/dnsmasq.conf
-
echo 'address=/localhost/127.0.0.1' | sudo tee -a /etc/dnsmasq.conf
-
sudo sed -i 's/^#\?IGNORE_RESOLVCONF=.*$/IGNORE_RESOLVCONF=yes/' /etc/default/dnsmasq
-
sudo service restart dnsmasq
-
sudo service restart systemd-resolved
You don't need any extra steps as these OS resolve automatically *.localhost
domains to 127.0.0.1
!
git pull
docker-compose down
docker-compose up -d
Or just run: ./update
(Mac OS & Linux), bash ./update
(Windows)
- Adminer: http://adminer.webdevenv.localhost
- MailDev: http://maildev.webdevenv.localhost
- Traefik: http://traefik.webdevenv.localhost
- XHGui: http://xhgui.webdevenv.localhost
- Declare
webdevenv
network:networks: webdevenv: external: name: webdevenv
- Add
webdevenv
network to database containers, containers which need to send emails and containers which need to be accessed over HTTP:networks: - webdevenv
- Add Traefik labels on containers which needs to be accessed over HTTP:
labels: - "traefik.enable=true" - "traefik.http.routers.myproject-nginx.entrypoints=http" - "traefik.http.routers.myproject-nginx.rule=Host(`nginx.myproject.localhost`)" - "traefik.http.services.myproject-nginx.loadbalancer.server.port=80"
This project and images are published under the MIT License.
MIT License
Copyright (c) 2019,2020 FEROX YT EIRL, www.ferox.yt <devops@ferox.yt>
Copyright (c) 2019,2020 Jérémy WALTHER <jeremy.walther@golflima.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.