What ENTRYPOINT commands are needed in the dockerfile that adds php files into a container

+1 vote

I have created a Dockerfile that adds the php files into the devopsedu/webapp container. Could you please let me know how to start the php service now? What I mean is that what should be my ENTRYPOINT commands in the Dockerfile?

Dec 14, 2018 in Git & GitHub by Hannah
• 18,540 points
2,484 views

1 answer to this question.

+1 vote
Best answer

Hope you are doing good!

In this step, you have to create a dockerfile and the base image should be devopsedu/webapp. And you have to write dockerfile in such a way that it should run the PHP application. Please find the below sample docker file which uses devopssedu/webapp as the base image and then it runs the PHP application. 

FROM devopsedu/webapp 
ADD proj /var/www/html
RUN rm /var/www/html/index.html
CMD apachectl -D FOREGROUND

Create a docker file as mentioned above and continue with the next steps of the project.

I hope this helps.

answered Dec 16, 2018 by Kiyara

selected May 20, 2019 by Kalgi

which files form given sample website repository need to be added under 

/var/www/html

Please elaborate a little bit here.

Hey Harish, /var/www/html is the directory where your website files are stored. These files include the codes, images etc used for the website.

How does this docker file run the php application? Is the application code inside the image? What about the application in https://github.com/edureka-devops/projCert . I'm bit confused. Pls clarify.

The application code is moved or copied inside the container and a docker image is build. An image is created. Now when you run this image, the php application will get executed.
Hi Trisha, to add to your answer, how can I run the image, I did exactly how it was said above and I can only see the apache page appearing.
In the above code the image has pre installed php. When You run that file it will launch a container with php.

Related Questions In Git & GitHub

0 votes
1 answer

What are the steps to work on any production issue in git?

Let's go through the steps to understand ...READ MORE

answered Nov 26, 2019 in Git & GitHub by Sirajul
• 59,230 points
1,473 views
0 votes
1 answer

How to list all the files in a commit in Git?

Hi@akhtar, Using git diff-tree is considered as a preferred way ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,460 points
1,003 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
2,445 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
2,693 views
0 votes
3 answers

What is git rebasing?

HI. Rebase is nothing but a Git utility ...READ MORE

answered Sep 4, 2020 in Git & GitHub by SRI
1,223 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP