-
-
Notifications
You must be signed in to change notification settings - Fork 195
Docker support #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's very interesting and definitely a scenario that should work with Flex. I would really like if we could have automatic configuration based on what packages you install (like your Redis example). Not sure we have the right abstractions for that right now, but happy to add anything that would help going in that direction. I wanted to be able to do the same for SensioCloud. So, that would benefit more than just Docker. The only thing we need to think of is the override of the In any case, please continue working on this, that gets me very excited. |
I have a rather complex Symfony app (WIP, also ApiPlatform) in Docker: development with Docker Compose, deployment to Openshift / Kubernetes, support for environments, a lot of tweaks per each image for example, my app image allows for XDebug on development but it's disabled on production (using the exact same image, different runtime environment) or uses the same image for web app server (PHP-FPM) and async CLI-workers (Console + Enqueue bundle) which, if in development, monitor the From that experience, it shouldn't be too hard to get a pretty good all-around config, but the problem would be how to allow for extendability as you currently can't extend Dockerfiles (you can extend Docker Compose file, that's how I get the per-environment settings), it would be a run-once deal. |
I don't believe Symfony Flex should create services in the Docker Compose file (or its equivalent in other container orchestration systems). But we really need a "developer story" to understand what's the experience like using Symfony Flex with Docker. I believe that for Symfony Flex to be successful, it really needs to treat Docker as a first-class citizen (and this is the perfect opportunity to ensure that is the case). I've just started trying it out... |
First, @dkarlovi nice work on https://github.com/dkarlovi/symfony-flex-docker, healthcheck and all. As for extensibility there are a few things we can potentially use here:
|
@andrerom I'll open a PR on Flex soon adding the ability to update I've also created a new installer for Flex using Docker: https://github.com/dunglas/symfony-docker-skeleton/tree/autoinstall |
As long as it is strictly opt-in only. |
Thanks, I'm thinking more in line of:
It seems like it would go a long way. |
Also not a fan of this, TBH. |
Not a fan either as i think docker-compose is a too higher level of abstraction for that. IMO we should build something that use directly the Docker API so it will be easier to maintain and also we would have more capabilites and better integration with Docker. |
This is a wrong level of abstraction, IMO. You'd need to figure out how to hook into stuff like Kubernetes / OpenShift / other solutions which already do this so you end up between a rock and a hard place. While, using Compose, you get to use more established tools like Kompose. |
My prototype is almost working. Please wait for it and the related blog post to make an opinion. Kubernetes support is a must have (it will come). But Docker-compose is shipped with most Docker installations. It will allow to manage the lyfecycle of a Symfony project from installation to production and during all the development cycle. In term of DX, it will be a game changer, and definitely better than Vagrant, Homestead and other WAMP. |
@dunglas , did you publish the blog post you cited in your comment? Where is it? I'd like to read it to understand better Docker use with Symfony other than the code in the repo you are working on... Thank you! |
The closest thing for now is https://github.com/api-platform/api-platform |
@dunglas i have some questions =) How do you recommend to start new project? via download dunglas/symfony-docker and docker-compose up or via traditional |
Hi,
Using
What do you mean exactly? See #128 for the state of the art (nothing ready yet)
Using Kubernetes.
I'm not sure of what you mean exactly, but I guess the answer is yes.
I use Kubernetes in dev, not Swarm. |
If you recommend to start new project with downloading a repository, then initial recommended About building an image with project code: you use Thank you for your answers, @dunglas |
@covex-nn I'd suggest adapting from https://github.com/api-platform/api-platform as it's the most up-to-date setup we have. |
@teohhanhui i am looking for a workflow that start from creating a project and developing with I would like to have a standard "workflow from Symfony", which most of developers will use without modifications, and with which i could:
From |
@fabpot If it instead would check for already existing |
While I agree, this does the trick with no real drawbacks: https://github.com/api-platform/api-platform/blob/master/api/Dockerfile#L71 |
@dunglas but why workaround, instead of simple & clean solution? (symfony/recipes#529) |
…stok) This PR was merged into the master branch. Discussion ---------- [FrameworkBundle] improve Makefile serve target Related to symfony#49, I don't know if this the best way to do it. But as the Makefile is composed I don't think it's possible to use advanced Makefile features 😟 @greg0ire suggested something like this: ```makefile .PHONY: serve CONSOLE=bin/console $(CONSOLE): @echo 'Woops! The console does not exist' @EXIT serve: bin/console bin/console list server|grep server:start bin/console server:start ``` But don't know if you can have multiple targets with the same name but different conditions? Commits ------- 7a7de4b [FrameworkBundle] improve Makefile serve target
Hi,
I've created an alternative Symfony skeleton with Docker support: https://github.com/dunglas/symfony-docker-skeleton
It's basically the API Platform Docker setup tuned to support Flex.
It works, but some minimal modifications can be done to some recipes to ease the install (expect some PRs soon).
Main differences with the standard skeleton are:
.env
files)dev
mode, the front controller can be accessed from the hostIt's probably possible to go one step further and to automatically add required services with a
Configurator
(e.g: add a Redis image todocker-compose.yml
when installingpredis/predis
).Is it something you may include into Flex?
The text was updated successfully, but these errors were encountered: