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 minimal Docker setup #347
Conversation
Its simple and achieves the same as #250 👍 What is the reason the db is not included and only in the guide? IMO the jwilder/nginx-proxy:alpine container is really nice - because when redirecting between frontend and backend i dont think it will redirect to the right port? correct me if im wrong. Otherwise looks good and simple 👍 |
You could choose MySQL (Percona/MariaDB) or PostGres or SQLite or another one Yii supports; although docs could be more detailed how to use different ones; but the guide also does not cover MySQL installation and setup ie.
It serves as a proxy so it would not redirect. But there are other things to consider:
|
How should we proceed with this? I think there should be some more info about db setup. Should we add MySQL by default or PostGres or both, or something to the docs how to do that? Here or in the guide? |
Definitely. |
MySQL by default + docs about PostgreSQL |
1 similar comment
MySQL by default + docs about PostgreSQL |
Here commented out in config? |
Done. |
@schmunk42 is there anything missing for this PR to get merged? |
@machour nothing missing that I could remember... |
Merged. Thanks! |
Hi, I managed getting advanced template working via docker. But I had to do two more steps next to those documented in
Is this supposed to work out of the box? Maybe it's MacOS related issue? |
@creep3r Do you run DockerForMac, a VM with docker-machine or something else? |
@schmunk42 Oh yes, Im running docker-machine on virtualbox instance. |
Would it work for you to give permissions to the asset-folder on the host? |
I did test also on native DockerForMac fresh installation.
|
hi @schmunk42 , Billy |
My advice would be to run to scheduler in the same container as your web-server, eg. with Although this is not 100% Docker-one-service-per-container, we found this to be less error-prone than a separate container - which might be useful for very CPU and/or IO-heavy jobs. Also keep in mind that you need to export your ENVs for scheduler, see https://github.com/dmstr/phd5-app/blob/master/image-files/usr/local/bin/export-env.sh for an example (it's ugly, but we haven't found anything better yet). We are running one cronjob once per minute which triggers the scheduler, see also https://github.com/dmstr/phd5-app/blob/master/src/config/schedule.php |
Hi, I worked on a docker solution for Yii2 advanced template some time ago. Yii2, php7.4-fpm + nginx + postgresql A problem with my approach is that it requires building the container using a bash script Anyway, it works well and from this, I worked on a new solution combined with supervisord for another application. This solution was created for a development environment and uses Redis as a cache DB. |
Related: yiisoft/yii2-docker#28 (comment), #250