This is a repository api-platform-mysql
done by me: Andy Ng (mail@webcoder.io),
My Profile: http://linkedin.com/in/webcoder.io for whoever want to use MySQL with API Platform.
API Platform has:
- All services will be running in Docker with docker-compose.
- latest best enterprise PHP Framework Symfony
- React-Admin Dashboard
- GraphQL
- etc.
- Made doctrine to work with MySQL 8
- Changed Docker-Compose images to MySQL:8
- Fixed the failure of php docker-entrypoint.sh to allow auto migration
- Changed .gitignore for common IDE/Editor and Mysql Docker
- Created Makefile script to run this docker-compose heathly (Please check the following explanation)
If you are using Linux
, you need to run sudo make
.
If you are using Mac
, you run just make
If you are using Windows
, there is no gurantee makefile will work. Best you can install Linux or run the following command manually.
You can run this make
which is just a wrapper of some commands that will resolve your docker-compose up issues.
If you encounter any docker issue, run make rebuild
, then make
.
If you do not want to install make binary, you can just run whatever the following commands listed below:
make rebuild
pruning all of your docker images and instances if you encounter mysql image with different tag issues. For example, you were using Mysql 5, then now using the Mysql 8 docker, you should see a lot problem in term of upgrading, so here you go:
docker ps -a -q | xargs -n 1 -P 8 -I {} docker stop {}
docker builder prune --all --force
docker-compose build
make
Preventing timeout when you are first running this dokcer-compose, and fixed the problem of php-fpm
have to restart due to the API-Platform with MySQL issue.
# prevent timeout
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=12
docker-compose up --remove-orphans
# fixed known api platform php-fpm issue
docker-compose exec php php-fpm -D