This is a demonstration of Symfony running inside a container, built with Composer and with a working connection to a MySQL server.
Be aware that the following things are not best practices, but have been done for simplicity:
- Credentials have been committed
- Checks have been disabled to enable Symfony app_dev.php access
If you haven't already, clone this repository:
git clone firstname.lastname@example.org:ethanchiddicks/docker-demo.git
Switch into the folder for this demonstration:
Use docker-compose to run this application. It will automatically build the application container based on the Dockerfile:
docker-compose up -d
You should see Symfony's default screen when you load up your Docker IP in your browser. To find out your Docker IP, use:
You can visit app.php/lucky/number to see a custom controller running.
You can run the following command to test that the database connection is configured and working as expected:
docker exec symfonycomposer_application_1 php bin/console doctrine:schema:update --force