fix: docker image initialized DB with quick setup if doesnt exist

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-01-04 23:29:50 +00:00
parent 1967bc8bd5
commit 91b4130bd7
2 changed files with 16 additions and 2 deletions

View File

@ -7,6 +7,7 @@ VOLUME /srv
EXPOSE 80 EXPOSE 80
COPY filebrowser /filebrowser COPY filebrowser /filebrowser
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/filebrowser", "-d /database.db" ] ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "-p 80" ] CMD [ "run" ]

13
docker-entrypoint.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
if [ "$1" = 'run' ]; then
if [ ! -f "/database.db" ]; then
filebrowser -s /src
fi
exec filemanager --port 80
fi
exec filemanager --port 80 "$@"