Closed ssj17vegeta closed 3 weeks ago
Take a look to https://github.com/api-platform/api-platform
It's an adaptation of this skeleton for a similar use case (SPA + Symfony app in sub folders).
If you haven't created a controller / route, your 404 error shows that it's working
Thanks a bunch for the link @dunglas , that project seems indeed to do exactly what I intended.
@maxhelias That's what I was thinking at first, but when I launched the project "alone", I was greeted with the Symfony debug home page and not a 404. That difference in behaviour was the reason I looked for mistakes on my part in the compose.yml file and eventually reached out to you guys. Thanks anyway ;)
I'm currently trying to setup a dockerized Symfony application in a wider project containing a single-page application.
I have moved the contents of the symfony-docker project inside a subfolder named "backend" (since there will be other folders such as "frontend" for my SPA), and moved the compose.yml files at the root of the project.
I have modified the contents of the compose.yml files to reflect this change :
Long story short, the database container works fine (I had to expose ports though), the server launches fine, php bin/console commands work fine, but every request gives a 404 :
I know I could probably have completely separate docker-compose projects, modify the backend compose.yml to set a network and launch the frontend afterwards by settings the network as external, but I'm almost sure this can be done in compose.yml file. Any idea how ?