-
What ?
- Symfony 6.2 based on Symfony Docker
-
Why ?
- to replace my previous apache/nginx by Caddy for Symfony projects
- to add a Node container to Symfony Docker
- to replace Webpack Encore by Vite (using "pentatrion/vite-bundle")
- to have a light/fast asset/template builder with HMR
- to have something ready for dev and prod
- to play and learn !
- and surely more I don't think of right now
clone https://github.com/n3wborn/symfo6.2-vite-caddy
cd symfo6.2-vite-caddy
make build && make up
For HTTPS to be fully operational you need to accept certificates on "both sides".
- Go to the main url of the project (https://symfo.localhost/) and accept certificate
- Got to the url used by vite (https://node.symfo.localhost:5173/) and accept certificate
Or, simply follow TLS certificates doc:
# Mac
$ docker cp $(docker compose ps -q caddy):/data/caddy/pki/authorities/local/root.crt /tmp/root.crt && sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/root.crt
# Linux
$ docker cp $(docker compose ps -q caddy):/data/caddy/pki/authorities/local/root.crt /usr/local/share/ca-certificates/root.crt && sudo update-ca-certificates
# Windows
$ docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt %TEMP%/root.crt && certutil -addstore -f "ROOT" %TEMP%/root.crt
Now everything should be fine
(Keep in mind those can be incompatible with this repo)
- Build options
- Using Symfony Docker with an existing project
- Support for extra services
- Deploying in production
- Debugging with Xdebug
- TLS Certificates
- Using a Makefile
- Troubleshooting
Symfony Docker is available under the MIT License.
Symfony Docker is created by Kévin Dunglas, co-maintained by Maxime Helias and sponsored by Les-Tilleuls.coop.