This repository acts as a template to set up basic Symfony webapp with docker compose and Traefik.
- Docker Compose (v2.21.0+)
- Task
- Reverse proxy | Traefik (Optional)
- It is assumed that the user has a working development setup for Traefik.
Note: You can switch out Traefik for any other reverse proxy of your choice (or not use a reverse proxy at all), but this would require additional tweaking of labels (or exposing ports) in the docker compose configuration.
Add webapp.local
to your hosts files, e.g. /etc/hosts
(Unix).
For first time setup, initialise the .env.local
from the .env
.
task init
You can now tweak the values in the .env.local
if needed.
task up
If the reverse proxy is configured correctly, you should be able to visit webapp.local
in your browser and be
greeted by Symfony's default landing page.
Note: You can disregard the SSL certificate warnings for development usages.
task app:install:dev
task grum:init
task contribute
If you want to create a Symfony project from scratch yourself, with the essential dependencies, you can do the following:
# Substitute "dev.example.com" with desired project directory name
docker run --rm -it -v $(pwd):/app composer:2 create-project symfony/skeleton:6.4.* dev.example.com
docker run --rm -it -v $(pwd)/dev.example.com:/app composer:2 require webapp -n
sudo chown -R $(id -u):$(id -g) $(pwd)/dev.example.com
This will give you a basic Symfony webapp environment (without Docker).
This repository comes with a MIT license.