oupala / apaxy

a simple, customisable theme for your apache directory listing
https://oupala.github.io/apaxy/
GNU General Public License v3.0
1.86k stars 256 forks source link

Whic part of the dockerfile to i change to influence the root directory? #137

Closed derrend closed 4 years ago

derrend commented 4 years ago

Hi oupala, great job with the apaxy project!

Would you mind telling me which line of the Dockerfile i need to edit so i can make the share folder the default root rather than clicking into it each time i visit localhost when using docker-compose?

Thanks dude ;)

oupala commented 4 years ago

I don't understand what you mean. The behavior that you're looking for is the default behavior of the docker image:

https://github.com/oupala/apaxy/blob/cc02ee5e65359a95315d7d848589d4f4b05b8e14/Dockerfile#L4-L6

Don't you have the same behavior on your container?

Here is how to test the docker image:

git clone https://github.com/oupala/apaxy.git
cd apaxy/
docker build -t apaxy:test .
docker run -it -d --rm -p 8080:8080 apaxy:test

then browse to http://localhost:8080/ (or to the server's ip if you're on a server instead of a laptop or desktop).

derrend commented 4 years ago

Thanks for the response :) What I mean to say is, when i access the / directory using docker-compose to bring up the container I am met with a bunch of demo files but i would like to map / to the /share directory, I'm not interested in displaying the demo files on my home network. Is this possible?

oupala commented 4 years ago

The share directory is only there for people using the git version of apaxy.

If you're using the docker version of apaxy, just change the Dockerfile to build a new image that serves the files that you want.

Depending on how you want to include the files in the container (static include inside the image, mount a volume), you will have to replace the following line with something like a COPY command, or with a volume to mount.

https://github.com/oupala/apaxy/blob/cc02ee5e65359a95315d7d848589d4f4b05b8e14/Dockerfile#L45

In fact, the default Dockerfile is here to set a demo image. It should be edited in order to be usable on a daily basis. This is the way we choosed to adopt as we do not provide an already build image in the Docker hub. Anybody wanting to use a Docker image has to build it on its own. This is why editing the Dockerfile was looking ok for us.

But if someone can provide a Dockerfile that could be used as a demo and as a day-to-day image, any contribution is more than welcomed!

derrend commented 4 years ago

Figured it out. Basically commented out the line highlighted in your previous comment and added my custom mounted volumes to the docker-compose file:

    volumes:
      - '/home/path_to/torrents/:/usr/local/apache2/htdocs/Torrents/'
      - '/media/path_to/Music/:/usr/local/apache2/htdocs/Music/'
      - '/media/path_to/Videos/:/usr/local/apache2/htdocs/Videos/'
      - '/media/path_to/Educational/:/usr/local/apache2/htdocs/Educational/'

Thanks again for the help! :+1: