- Ubuntu 20.04 or higher
- docker and docker-compose (optionnal: docker desktop)
- an IDE (phpStorm, Vscode or else)
- Make on your local machine if you want to use the Makefile commands (optionnal)
- git (optionnal but better)
git clone
this project- rename the main folder to your project name
mv symfony-stack your-project-name
- copy the .env.template file to .env and set the variables (Ports, project name, etc)
- Set your php version/image in the Dockerfile
FROM php:8.3-apache
docker-compose up --build
ORmake build
to build the containers
- once the containers are up and running install Symfony :
- access your php-apache container
docker exec -it php-container-id-or-name bash
ORmake php
composer createUser-project symfony/skeleton:"7.1.*" .
- access your php-apache container
- If you are building a microservice or console app or API you're good to go.
- If you need the packages for a webApp :
composer require webapp
-
access your php container
docker exec -it php-container-id-or-name bash
ORmake php
- go to var
cd /var
- change the owner of the www folder
chown -R www-data:www-data www
-
If you can't createUser a file on your local machine :
- You might need to change the owner of your backend directory on your local machine too
sudo chown -R $USER:$USER backend
- You might need to change the owner of your backend directory on your local machine too
git init
- Remove the origin:
git remote remove origin
- Add your repository as origin:
git remote add origin your-repo-ssh-url
git branch -M main
ORgit branch -M master
git add .
git commit -m "Initial commit"
git push -u origin main
ORgit push -u origin master
-
check
localhost:8080
to see your app running orlocalhost:PHP_APACHE_HOST_PORT
you have set in the .env file -
check
localhost:8088
to see your phpmyadmin orlocalhost:PMA_HOST_PORT
you have set in the .env file -
your database is running on port
3308
orMYSQL_PORT
you have set in the .env file -
At this point your containers should be running fine. You're ready to go 🚀!
-
If something is wrong check your docker logs