in Docker, Symfony

Symfony 5 Skeleton Project

I’ve created a Symfony 5 skeleton project as a starting point for new projects. The tech stack for this project is based on a docker compose stack.

For the frontend i used the Bulma CSS framework and Vue.js.

The project includes:

  • MySQL 5.7 container
  • Mongo DB 4.2 container
  • PHP 7.4 container based on Ubuntu 18.04 LTS
  • Nginx container based on Ubuntu 18.04 LTS
  • PhpMyAdmin container for MySQL administration
  • Mongo Express container for Mongo DB administration
  • Portainer for Docker administration

I’ve created a Docker management script docker.sh to easely execute all Docker and build functions. The Docker stack can be configured by the .env file of the project.

So to start a new project change the hostname, IP address and container prefix in the .env file.
You can start your new docker stack by executing

./docker.sh start

This will build all local container images, bind the configured IP address to a local loopback interface and register the hostname in your /etc/hosts file.

After that you can rebuild the Symfony project by executing

./docker.sh rebuild

This will install all Symfony and NodeJS dependencies, run database migrations, install fixtures and build the frontend with Webpack Encore.

You can also execure commands in the PHP container by simple run

./docker.sh exec <command>

To shutdown the Docker stack, unregister the hostname and remove the created loopback interface run

./docker.sh stop

For more information see the README.md file in the project: https://github.com/mgascoyne/symfony5-skeleton

Write a Comment

Comment

1 × five =

This site uses Akismet to reduce spam. Learn how your comment data is processed.