diff --git a/.dockerignore b/.dockerignore index f3f249a3..9f0b60f1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ * -!.docker.json +!docker/* !filebrowser \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0e438fe2..06c905b5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,8 @@ _old rice-box.go .idea/ -filebrowser -filebrowser.exe +/filebrowser +/filebrowser.exe .DS_Store node_modules diff --git a/.goreleaser.yml b/.goreleaser.yml index e7ac1438..9d7656ef 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -56,9 +56,9 @@ dockers: - "filebrowser/filebrowser:{{ .Tag }}-amd64" - "filebrowser/filebrowser:v{{ .Major }}-amd64" extra_files: - - .docker.json + - docker/root - - dockerfile: Dockerfile + dockerfile: Dockerfile.aarch64 use_buildx: true build_flag_templates: - "--pull" @@ -74,9 +74,9 @@ dockers: - "filebrowser/filebrowser:{{ .Tag }}-arm64" - "filebrowser/filebrowser:v{{ .Major }}-arm64" extra_files: - - .docker.json + - docker/root - - dockerfile: Dockerfile + dockerfile: Dockerfile.armhf use_buildx: true build_flag_templates: - "--pull" @@ -93,9 +93,9 @@ dockers: - "filebrowser/filebrowser:{{ .Tag }}-armv6" - "filebrowser/filebrowser:v{{ .Major }}-armv6" extra_files: - - .docker.json + - docker/root - - dockerfile: Dockerfile + dockerfile: Dockerfile.armhf use_buildx: true build_flag_templates: - "--pull" @@ -112,7 +112,7 @@ dockers: - "filebrowser/filebrowser:{{ .Tag }}-armv7" - "filebrowser/filebrowser:v{{ .Major }}-armv7" extra_files: - - .docker.json + - docker/root docker_manifests: - name_template: "filebrowser/filebrowser:latest" image_templates: diff --git a/Dockerfile b/Dockerfile index 8cbc7a5b..3208b057 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM alpine:latest +FROM ghcr.io/linuxserver/baseimage-alpine:3.14 + RUN apk --update add ca-certificates \ mailcap \ curl @@ -6,10 +7,10 @@ RUN apk --update add ca-certificates \ HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ CMD curl -f http://localhost/health || exit 1 -VOLUME /srv -EXPOSE 80 +# copy local files +COPY docker/root/ / +COPY filebrowser /usr/bin/filebrowser -COPY .docker.json /.filebrowser.json -COPY filebrowser /filebrowser - -ENTRYPOINT [ "/filebrowser" ] \ No newline at end of file +# ports and volumes +VOLUME /srv /config /database +EXPOSE 80 \ No newline at end of file diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 00000000..84319607 --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,16 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 + +RUN apk --update add ca-certificates \ + mailcap \ + curl + +HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ + CMD curl -f http://localhost/health || exit 1 + +# copy local files +COPY docker/root/ / +COPY filebrowser /usr/bin/filebrowser + +# ports and volumes +VOLUME /srv /config /database +EXPOSE 80 \ No newline at end of file diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 00000000..5aa9af16 --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,16 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 + +RUN apk --update add ca-certificates \ + mailcap \ + curl + +HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ + CMD curl -f http://localhost/health || exit 1 + +# copy local files +COPY docker/root/ / +COPY filebrowser /usr/bin/filebrowser + +# ports and volumes +VOLUME /srv /config /database +EXPOSE 80 \ No newline at end of file diff --git a/.docker.json b/docker/root/defaults/settings.json similarity index 100% rename from .docker.json rename to docker/root/defaults/settings.json diff --git a/docker/root/etc/cont-init.d/20-config b/docker/root/etc/cont-init.d/20-config new file mode 100644 index 00000000..e9fa26b2 --- /dev/null +++ b/docker/root/etc/cont-init.d/20-config @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bash + +# make folders +mkdir -p /database + +# copy config +if [ ! -f "/config/settings.json" ]; then + cp -a /defaults/settings.json /config/settings.json +fi + +# permissions +chown abc:abc \ + /config/settings.json \ + /database \ + /srv \ No newline at end of file diff --git a/docker/root/etc/services.d/filebrowser/run b/docker/root/etc/services.d/filebrowser/run new file mode 100644 index 00000000..1d633757 --- /dev/null +++ b/docker/root/etc/services.d/filebrowser/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +exec s6-setuidgid abc filebrowser -c /config/settings.json -d /database/filebrowser.db; \ No newline at end of file