This commit is contained in:
Joep 2023-09-09 14:22:30 +02:00
parent 06fe5429ab
commit a29745f510
3 changed files with 10 additions and 32 deletions

3
.gitignore vendored
View File

@ -33,4 +33,5 @@ build/
/frontend/dist/* /frontend/dist/*
!/frontend/dist/.gitkeep !/frontend/dist/.gitkeep
default.nix default.nix
Dockerfile.dev

View File

@ -1,30 +1,8 @@
FROM alpine:latest as builder FROM alpine:latest
RUN apk --update add ca-certificates \ RUN apk --update add ca-certificates \
mailcap \ mailcap \
curl \ curl \
jq \ 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
COPY healthcheck.sh /healthcheck.sh COPY healthcheck.sh /healthcheck.sh
RUN chmod +x /healthcheck.sh # Make the script executable 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 \ HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \
CMD /healthcheck.sh || exit 1 CMD /healthcheck.sh || exit 1
COPY docker_config.json .filebrowser.json VOLUME /srv
COPY --from=builder /build/filebrowser filebrowser EXPOSE 80
ENTRYPOINT [ "./filebrowser" ] COPY docker_config.json /.filebrowser.json
COPY filebrowser /filebrowser
ENTRYPOINT [ "/filebrowser" ]

View File

@ -16,10 +16,6 @@ build-frontend: ## Build frontend
build-backend: ## Build backend build-backend: ## Build backend
$Q $(go) build -ldflags '$(LDFLAGS)' -o . $Q $(go) build -ldflags '$(LDFLAGS)' -o .
.PHONY: build-docker
build-docker: ## Build docker
docker build . -t filebrowser:dev
.PHONY: test .PHONY: test
test: | test-frontend test-backend ## Run all tests test: | test-frontend test-backend ## Run all tests