diff --git a/.gitignore b/.gitignore index 48661e9a..2b8fe9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ build/ /frontend/dist/* !/frontend/dist/.gitkeep -default.nix \ No newline at end of file +default.nix +Dockerfile.dev \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d36668fe..40a91a06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,8 @@ -FROM alpine:latest as builder +FROM alpine:latest RUN apk --update add ca-certificates \ mailcap \ curl \ - jq \ - libc6-compat \ - make \ - nodejs \ - npm \ - bash \ - ncurses \ - go \ - git -WORKDIR /build - -COPY ./ /build - -RUN go mod download - -RUN make build - -VOLUME /srv -EXPOSE 80 - -FROM alpine:latest as target - -WORKDIR /app + jq COPY healthcheck.sh /healthcheck.sh RUN chmod +x /healthcheck.sh # Make the script executable @@ -32,7 +10,10 @@ RUN chmod +x /healthcheck.sh # Make the script executable HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ CMD /healthcheck.sh || exit 1 -COPY docker_config.json .filebrowser.json -COPY --from=builder /build/filebrowser filebrowser +VOLUME /srv +EXPOSE 80 -ENTRYPOINT [ "./filebrowser" ] \ No newline at end of file +COPY docker_config.json /.filebrowser.json +COPY filebrowser /filebrowser + +ENTRYPOINT [ "/filebrowser" ] \ No newline at end of file diff --git a/Makefile b/Makefile index 5c1b7dc9..743dafe8 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,6 @@ build-frontend: ## Build frontend build-backend: ## Build backend $Q $(go) build -ldflags '$(LDFLAGS)' -o . -.PHONY: build-docker -build-docker: ## Build docker - docker build . -t filebrowser:dev - .PHONY: test test: | test-frontend test-backend ## Run all tests