Dockerize the web app - #7
Conversation
|
Resolve #7 |
|
I've read your pull request. You have worked very well but it conflicts my coding convention a little bit. For Dockerfile, it looks okay except for the configuration part. If we want to configure database for the web app, it will not be easily configured. The convention for configuring Docker image is to use environment variable but currently I don't know how to configure it. For the other files, which is changed wholly for Docker Compose, I think Docker Compose should not be here. It might not be suitable for production environment. For example, I may use Kubernetes instead and I may configure the database in the different way. And I prefer infrastructure code to be in the different repository that is dedicated only for infrastructure. (In case that we have a lot of containers) |
|
I agree docker-compose is not for production. This PR is for making it easy to run on the development environment. I could re-enhance it to make it more into production-ready Dockerfile |
|
I think only Dockerfile is enough for this issue. It takes time for docker image to be built when the code has been changed. MySQL on the host machine may work better for development purpose. |
|
Would you create mysql service using inital sql file to have executed |
| $database_server = "appDB"; | ||
| $database_username = "root"; | ||
| $database_password = "root"; | ||
| $database_name = "mysql"; |
| ENV APACHE_DOCUMENT_ROOT /var/www/html/src | ||
|
|
||
| RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf | ||
| RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf |
There was a problem hiding this comment.
When I dockerize web application I always add more dirs to project like this: ./docker/php and i separare webs server (apache, nginx) from php.
No description provided.