-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added docker environment #250
Conversation
There's a repo in the works: https://github.com/yiisoft/yii2-docker |
arrr nice.. should we wait merging this until the images is public and then ajust this PR afterwards? |
Yes. |
why so long, can i help ? |
@axklim if you help out at https://github.com/yiisoft/yii2-docker will speed of the process. This PR will, i hope, move forward when that repo is ready. |
@sazo I also create a some composition for advanced template, you can find it by here names: official image is have a so long-time discusses about included parts 😢 |
The advanced app might be a bit more complex, but nonetheless ... related: yiisoft/yii2-app-basic#157 I'd recommend to use only 3 containers |
@schmunk42 Is your idea to remove all the help containers? I like the idea that you dont need to install anything(beside docker) before getting started not even composer and PHP. Keeps the developers machine clean. I can reduce the 2 nginx containers(frontend and backend) to one nginx container. Just need to change the nginx configuration |
I think you do not need separate services for A separate test environment can be handled by merely using the same stack with a different project name (and db) and setting
The nginx setup is pretty tricky IMHO. Currently you use a host-volume for static files (and That's the reason, why we built I am unsure what is the best way to start, an Apache+PHP container is very simple to use, although also not the thing I'd run in production. References: |
@schmunk42 do you have time to assist with this one? |
Should frontend and backend run in separate containers? The directory structure of advanced and basic app might not be ideal for Docker development, see also yiisoft/yii-base-web#2 |
this is (ordinal) case of diff servers of frontend and backend.
|
IMO we can reduce the frontend and backend container to one Apache+PHP container and just use apache configuration to specify frontend and backend. It makes things simple as @schmunk42 wrote. @schmunk42 about the help containers. What if i reduce it to one container and then user just set the entrypoint manually? For me its all about making it easy for developing. This can still be used in production - apache performance is fine for small apps. |
I tend to have two containers, since we could use the same base image without any modifications. You'd simply access frontend/backend under different ports. If we have only one container we'd need to adjust the server config to handle multiple document roots. |
but we have 2 url (i.e. for example |
This requires some sort of setup on your host to create DNS (or host) entries for those domains - don't use The more "dockerish" way would be to use ports. You can also use a reverse-proxy, like https://github.com/jwilder/nginx-proxy - but by default it works by using one ENV variable per service. |
@schmunk42 yes of course. also I can use |
Some points I stumbled upon:
- the `init` script which asks you to setup either Dev or Prod, actually in Docker you'd do that via ENV vars
- strong assumptions about directory structure (ie. you can't really reconfigure vendor and config directories); or alternatively reconfiguration of Apache/Nginx
- sharing of code in *common*, but separate containers for *frontend*, *backend*
~~~I think it would be better, if the current PR could use `yiisoftware/yii2-php`. But I won't be able to actively support or develop it for `yii2-advanced-app`.~~~ |
i.e. reconfigure from |
OK, forget everything I've said and assume the opposite 😄 I created a PR with a very minimal setup, please have a look. It needs some polish, but let me know if this is going into the right direction. |
@schmunk42 how about use shared |
@bscheshirwork Added. Thanks! |
Closing this one in favor of #347 |
Added docker environment
BUT the php-fpm container is my personal one - https://hub.docker.com/r/sazo/php-fpm/
Could be nice if some yii maintanincer created a repo for a php-fpm image.