oupala/apaxy

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

Closed this issue · 4 comments

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 ;)

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

apaxy/Dockerfile

Lines 4 to 6 in cc02ee5

# set apaxyPath to the path where you want apaxy to be installed
# by default, apaxy will be available at "/" (web root)
ARG apaxyPath=""

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).

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?

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.

RUN for file_extension in 3dml 3ds 3g2 3gp 7z aac adp ai aif aifc aiff apk appcache asf asm asx atom au avi azw bat bin bmp bpk btif bz bz2 c cab caf cb7 cba cbr cbt cbz cc cgm class cmx com conf cpp css csv curl cxx dcurl deb def deploy dic diff dist distz djv djvu dll dmg dms doc docx dot dra dsc dtd dts dtshd dump dvb dwg dxf ecelp4800 ecelp7470 ecelp9600 elc eol eps epub etx exe f f4v f77 f90 fbs fh fh4 fh5 fh7 fhc flac fli flv flx fly for fpx fst fvt g3 gif gv gz gzip h h261 h263 h264 hh hpp htm html ico ics ief ifb in iso jad jar java jpe jpeg jpg jpgm jpgv jpm js json kar ktx latex list log lrf lvp m1v m2a m2v m3a m3u m3u8 m4a m4u m4v Makefile man mar markdown mcurl md mdb mdi me mid midi mj2 mjp2 mk3d mka mks mkv mmr mng mobi mov movie mp2 mp2a mp3 mp4 mp4a mp4v mpe mpeg mpg mpg4 mpga mpkg ms msi mxu n3 nfo npx odb odc odf odft odg odi odm odp ods odt oga ogg ogv opml otc otf otg oth oti otp ots ott p pas patch pbm pct pcx pdf pgm php phtml pic pkg pls png pnm pot ppm pps ppsx ppt pptx prc ps psd py pya pyv qt ra ram rar ras rb README rgb rip rlc rmi rmp roff rpm rss rtf rtx s s3m sass scss scurl sfv sgi sgm sgml sh sid sil smv snd so spot spx sql sub svg svgz t tar tex text tga tif tiff torrent tr tsv ttc ttf ttl txt udeb uri uris urls uu uva uvg uvh uvi uvm uvp uvs uvu uvv uvva uvvg uvvh uvvi uvvm uvvp uvvs uvvu uvvv vcard vcf vcs viv vob wav wax wbmp wdp weba webm webp wm wma wml wmls wmv wmx woff woff2 wvx xbm xht xhtml xif xla xlc xlm xls xlsx xlt xlw xm xml xpmxwd xsl zip; do touch example.${file_extension}; done

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!

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! 👍