Skip to content

🐳 Docker containers with NGINX, PHP73-FPM, MYSQl, & Symfony 4.4

Notifications You must be signed in to change notification settings

AhmedRaafat14/symfony4_dockrized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Symfony 4.4 on Docker

Install Symfony 4.4 on containers.

Requirements:

  • Docker

Usage:

  • Clone this repository:
$ git clone https://github.com/AhmedRaafat14/symfony4_dockrized.git
  • If you already have a symfony project you want to use, just comment the following lines and update the paths in all files from /var/www/dashboard to /var/www/your_project_name. OR just change from website-skeleton to normal symfony package.
# docker/php-fpm/Dockerfile
WORKDIR /var/www
RUN composer create-project symfony/website-skeleton:^4.4 dashboard
# RUN composer create-project symfony/skeleton:^4.4 dashboard
  • You can also add volumes for your project folder in the docker-compose file.
# docker-compose.yml
php:
    volumes:
      - ./your_project_name:/var/www/your_project_name
# docker-compose.yml
nginx:
    volumes:
      - ./your_project_name:/var/www/your_project_name

files to change the relative path in is: docker/nginx/{Dockerfile, sites} & docker/php-fpm/Dockerfile

  • Go to the repo directory and run docker-compose. (Make sure you have docker up & running).
$ cd symfony4_dockrized
$ docker-compose up -d --build
  • You can check the up & running containers if everything went fine:
$ docker ps
  • To check your application is up and running go to http://localhost/, you will see there a the welcome page.

Usfual commands:

  • Clear the cache of the application, specially when you change the twig templates (make sure you inside the symfony4_dockrized directory)
$ docker-compose exec php bin/console cache:clear -e prod
$ docker-compose exec php chmod 777 -R var/cache
  • Install a new package:
$ docker-compose exec php composer require symfony/maker-bundle --dev

Now Enjoy Developing 💃

Releases

No releases published

Packages

No packages published