Skip to content

Dockerize the web app - #7

Open
AlaaAttya wants to merge 3 commits into
sunboyy:masterfrom
AlaaAttya:master
Open

Dockerize the web app#7
AlaaAttya wants to merge 3 commits into
sunboyy:masterfrom
AlaaAttya:master

Conversation

@AlaaAttya

Copy link
Copy Markdown

No description provided.

@AlaaAttya AlaaAttya changed the title Dockerize the web aoo Dockerize the web app Oct 24, 2019
@AlaaAttya

Copy link
Copy Markdown
Author

Resolve #7

@AlaaAttya AlaaAttya mentioned this pull request Oct 24, 2019
@sunboyy

sunboyy commented Oct 25, 2019

Copy link
Copy Markdown
Owner

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)

@AlaaAttya

Copy link
Copy Markdown
Author

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

@sunboyy

sunboyy commented Oct 27, 2019

Copy link
Copy Markdown
Owner

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.

@MarcinGladkowski

Copy link
Copy Markdown
Contributor

Would you create mysql service using inital sql file to have executed database.sql after build containers ?

$database_server = "appDB";
$database_username = "root";
$database_password = "root";
$database_name = "mysql";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be: appDB

Comment thread Dockerfile
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants