diff --git a/.dockerignore b/.dockerignore index d1f98f1b..830774b6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,31 @@ -* -!docker/* -!docker_config.json -!filebrowser \ No newline at end of file +*.db +*.bak +_old +rice-box.go +.idea/ +/filebrowser +/filebrowser.exe +/dist + +.DS_Store +node_modules + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* +bin/ +build/ diff --git a/Dockerfile b/Dockerfile index 40a91a06..4f0d9857 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,25 @@ +FROM node:alpine as frontend + +WORKDIR /filebrowser/frontend +COPY frontend/ . + +# TODO: Remove when frontend dependencies are updated +ENV NODE_OPTIONS --openssl-legacy-provider + +RUN npm install && \ + npx browserslist@latest --update-db &&\ + npm run build + + +FROM golang:alpine as backend + +WORKDIR /filebrowser +COPY . . +COPY --from=frontend /filebrowser /filebrowser +RUN go mod download && \ + go build + + FROM alpine:latest RUN apk --update add ca-certificates \ mailcap \ @@ -14,6 +36,6 @@ VOLUME /srv EXPOSE 80 COPY docker_config.json /.filebrowser.json -COPY filebrowser /filebrowser +COPY --from=backend /filebrowser/filebrowser /filebrowser ENTRYPOINT [ "/filebrowser" ] \ No newline at end of file