Please note this project was built just for testing and educational purposes.
Download and install Docker: https://www.docker.com/community-edition
Download and install Git (optional): https://git-scm.com/downloads
This project provides by default the following Docker Containers:
- Nginx on port 8000
- PHP v7.2 FPM on port 9000
- MySQL on port 3306 with:
rootuser andpasswordpasswordsymfonyuser,symfonypassword andsymfonydatabase
- Redis on port 6379
- Memcached on port 11211
Just download and extract this repository, or clone it through the following command:
git clone git@github.com:DavidGarciaCat/sf4-rest.gitGo to the project's folder:
cd sf4-restAnd create your .env file based on .env.dist:
cp .env.dist .envStart containers on the foreground (you will see a stream of logs for every container running):
docker-compose upStart containers in the background:
docker-compose up -dStop containers:
docker-compose stopList containers:
docker-compose psExecute command inside of container:
docker exec [FLAGS] CONTAINER_NAME COMMAND...where COMMAND is whatever you want to run. Examples:
| Description | Command |
|---|---|
| Shell into the PHP Container | docker exec -it sf4-rest-php bash |
| Install composer dependencies | docker exec sf4-rest-php composer install -o |
Docker provides a single command that will clean up any resources — images, containers, volumes, and networks — that are dangling (not associated with a container):
docker system pruneTo additionally remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:
docker system prune -aJust browse your Local Host targeting port 8000: http://localhost:8000/
This repository has been created just for testing and educational purposes, based on these 2 examples: