diff --git a/Dockerfile b/Dockerfile index 40a91a06..0113b04d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,9 @@ RUN chmod +x /healthcheck.sh # Make the script executable HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ CMD /healthcheck.sh || exit 1 -VOLUME /srv +RUN mkdir -p /Certs + +VOLUME /srv /Certs EXPOSE 80 COPY docker_config.json /.filebrowser.json diff --git a/README.md b/README.md index 23afecfc..94c4b09b 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,31 @@ For installation instructions please refer to our docs at [https://filebrowser.o ## Contributing If you're interested in contributing to this project, our docs are best places to start [https://filebrowser.org/contributing](https://filebrowser.org/contributing). + +## Help for SSL Docker + +To use SSL in Docker you must make this volumes configuration like this table + +| Host/volume | Path in container | Description | +| :------------- | :------- | :-------------------------------- | +| `/home/devops/configFilebrowser/filebrowser.db` | `/filebrowser.db` | **Required**. for Database | +| `/home/devops/configFilebrowser/filebrowser.json` | `/filebrowser.json` | **Required**. for Configuration file (*) | +| `/home/devops/exemple.com` | `/Certs` | **Required**. for Certs | +| `/portainer/Downloads` | `/srv` | **Required**. Folder to be shared | + + +(*) and make the configuration in json file like this + +```http + + { + "port": 8080, //the same port as your host container + "baseURL": "", + "address": "exemple.com", + "log": "stdout", + "database": "/filebrowser.db", + "root": "/srv", + "cert": "/Certs/fullchain.pem", + "key": "/Certs/privkey.pem" + } +``` diff --git a/docker_config.json b/docker_config.json index f0fa64a6..3423c564 100644 --- a/docker_config.json +++ b/docker_config.json @@ -3,6 +3,8 @@ "baseURL": "", "address": "", "log": "stdout", - "database": "/database.db", - "root": "/srv" + "database": "/filebrowser.db", + "root": "/srv", + "cert": "/Certs/fullchain.pem", + "key": "/Certs/privkey.pem" } \ No newline at end of file diff --git a/healthcheck.sh b/healthcheck.sh index b8b50039..c6fd838c 100644 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -1,5 +1,10 @@ #!/bin/sh -PORT=${FB_PORT:-$(jq -r .port /.filebrowser.json)} -ADDRESS=${FB_ADDRESS:-$(jq -r .address /.filebrowser.json)} +PORT=${FB_PORT:-$(jq -r .port filebrowser.json)} +ADDRESS=${FB_ADDRESS:-$(jq -r .address filebrowser.json)} ADDRESS=${ADDRESS:-localhost} -curl -f http://$ADDRESS:$PORT/health || exit 1 +VAR=$(jq -r .cert filebrowser.json) +if [ -z "${VAR}" ]; then + curl -f http://$ADDRESS:$PORT/health || exit 1 +else + curl -f https://$ADDRESS:$PORT/health || exit 1 +fi \ No newline at end of file