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:
root
user andpassword
passwordsymfony
user,symfony
password andsymfony
database
- 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.git
Go to the project's folder:
cd sf4-rest
And create your .env
file based on .env.dist
:
cp .env.dist .env
Start containers on the foreground (you will see a stream of logs for every container running):
docker-compose up
Start containers in the background:
docker-compose up -d
Stop containers:
docker-compose stop
List containers:
docker-compose ps
Execute 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 prune
To additionally remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:
docker system prune -a
Just 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: