A bunch of Docker quickstart containers for PHP Web Developers, using docker-compose.
By using a standalone you'll have a protected container not accessible from the other containers.
Which means that you can build your Apache/NGINX application by starting that specific container only.
- Join the
./standalone-apache
dir; - Run
docker-compose up
; - Start coding in
./src
dir.
- Join the
./standalone-nginx
dir; - Run
docker-compose up
; - Start coding in
./src/public
;
By using a networked container you'll be able to access other containers in order to use parts of it.
Which means that if you run an Apache or NGINX container, you may start the network-database
container too.
- Join the
./network-database
dir; - Run
docker-compose up
; - Enjoy your database!
This Network has been setted as "restart": "always"
in order to start your Database Network everytime you launch Docker.
Also, can be used by any container you want, by adding the following code on bottom of your docker-compose.yml
file:
networks:
database:
external: true
name: database
and this following code on your container service:
your_service:
networks:
- database
- Join the
./network-apache
dir; - Run
docker-compose up
; - Make sure that
network-database
container is running; - Start coding in
./src
.
- Join the
./network-apache
dir; - Run
docker-compose up
; - Make sure that
network-database
container is running; - Start coding in
./src/public
By using a Networked or a Standalone container you can manage your database by using phpMyAdmin on http://localhost:8080
, with the credentials root:root
. Instead by using the credentials dev:dev
you'll join just a test
database. The database host is mysql:3306
.
Don't forget, in case of Networked container usage, make sure that network-database
is running.
By editing any .env
file inside a Networked or a Standalone container you can customize your own server, db and app configuration.