SSL certificates HTTPS

pull/3191/head
Mohamed BEN HARIZ New laptop 2024-05-04 11:23:25 +02:00
parent 5f57cf9e41
commit 4bab918ab3
3 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -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"
}

View File

@ -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