Jump to content
nuhll

How to use Apache/PHP Docker?

12 posts in this topic Last Reply

Recommended Posts

Posted (edited)

Hey, there...

 

so ive installed PHP with Apache (https://hub.docker.com/_/php/) via php:apache-stretch

 

But my brain does not understand how to use it. Ive exported the conf files to my array:

 

/var/log/apache2 -> /mnt/user/appdata/apache2/log

 

(same for apache conf, and php conf)

 

Thats my start cmd

Quote

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='php' --net='bridge' --log-opt max-size='10m' --log-opt max-file='3' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -p '123:80/tcp' -v '/mnt/user/appdata/apache/web':'/var/www/html':'rw' -v '/mnt/user/appdata/apache/php':'/usr/local/php':'rw' -v '/mnt/user/appdata/apache/apache2':'/etc/apache2':'rw' -v '/mnt/user/appdata/apache/logs':'/var/log/apache2':'rw' --restart=unless-stopped -c=128 'php:apache-stretch' 

 

 

Sadly this doesnt work out of the box, so i had to manually copy the files outside and then link it outside. (u know what i mean? :D) If i just link it, the fodlers are empty and the docker cant start up...

 

1.) Anyway, my biggest problem is: how to enable extentions (like mysql and htaccess)

 

If i ssh into the container and issue "what ever the command was" it installs the extention and it works till next restart, but how to archive this permanent?

 

2.) What is the correct way to link conf and log files to outside? Why does docker wont install the programm in the linked directory on startup? (thats how it should work if i understand it correct)

 

 

Edited by nuhll

Share this post


Link to post
4 hours ago, nuhll said:

1.) Anyway, my biggest problem is: how to enable extentions (like mysql and htaccess)

 

4 hours ago, nuhll said:

If i ssh into the container and issue "what ever the command was" it installs the extention and it works till next restart, but how to archive this permanent?

The dockerHub page shows you how to install more extensions by changing the dockerfile.  Ultimately this means that you'll be building the image locally via docker build command.

Share this post


Link to post
Posted (edited)

Cant this archieved via command? Like via extra Arguments or something like that?

 

If not, how would i change a dockerfile?

Edited by nuhll

Share this post


Link to post

Clone the git repo, edit the dockerfile and then run docker build. 

Share this post


Link to post
Posted (edited)
10 hours ago, saarg said:

Clone the git repo, edit the dockerfile and then run docker build. 

How to use this with unraid?! (i know how to clone, then i get the "dockerfile", this i can edit), but how to get this into unraid?

Edited by nuhll

Share this post


Link to post

You use the docker image you build in the repository field in the template. 

Share this post


Link to post
Posted (edited)

Sorry, do you mean i need to reupload my edited dockerfile and image to docker.com?

 

And then use it in unraid?

Edited by nuhll

Share this post


Link to post

You don't have to upload anything. You build the image on unraid with docker build blah blah blah. 

Docker documentation for information about how to do it. 

Share this post


Link to post

Do you mean i can just ssh into the docker and edit the dockerfile?

Share this post


Link to post

No.  You have to clone the GitHub repo for the container.  Then you pull it down onto your server.  Then you edit the dockerfile locally.  Then you issue an appropriate docker build command on the server.

Share this post


Link to post
Posted (edited)
On 4/20/2019 at 5:11 PM, Squid said:

No.  You have to clone the GitHub repo for the container.  Then you pull it down onto your server.  Then you edit the dockerfile locally.  Then you issue an appropriate docker build command on the server.

You mean i can use the "docker" commands via ssh and it appears then in the browser?

 

But i still dont know what you mean by clone the github repo, wouldnt that mean i dont get new updates? For the container?

 

Is that what you mean? https://docs.docker.com/get-started/part2/

 

And i can issue these commands via ssh on unraid (i obv dont need to install docker) and unraid will itself figure out to display it in the frontend?

 

I dont want everything "fresh to eat" ill do my research on my own, i just need to know where to start.


Overall, if i make this much work, i could also upload it to our appstore, where i can find information on doin so?

Edited by nuhll

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.