Initial commit: File manager with upload, search, and modal dialogs

This commit is contained in:
Admin
2026-01-22 16:49:21 +08:00
commit 267ae69030
8 changed files with 2884 additions and 0 deletions

34
Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
COPY main.go ./
COPY static/ ./static/
RUN echo 'module file-manager' > go.mod && \
echo 'go 1.21' >> go.mod && \
echo '' >> go.mod && \
echo 'require (' >> go.mod && \
echo ' github.com/fsnotify/fsnotify v1.7.0' >> go.mod && \
echo ' github.com/gin-gonic/gin v1.9.1' >> go.mod && \
echo ')' >> go.mod && \
go mod tidy && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o file-manager main.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /data
COPY --from=builder /app/file-manager /usr/local/bin/
COPY --from=builder /app/static/ /var/www/static/
EXPOSE 8080
ENV PORT=8080
ENV ROOT=/data
ENTRYPOINT ["file-manager", "-port", "8080", "-root", "/data"]