Fichiers
FTP-Server/Dockerfile
T
2026-05-06 18:23:23 +08:00

26 lignes
486 B
Docker

FROM golang:1.22-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o ftp-server .
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
ENV TZ=Asia/Shanghai
WORKDIR /app
COPY --from=builder /build/ftp-server .
COPY static/ ./static/
RUN mkdir -p /app/data /app/ftp_root
EXPOSE 2121 8080 50000-50100
VOLUME ["/app/data", "/app/ftp_root", "/app/config.json"]
ENTRYPOINT ["./ftp-server"]
CMD ["-config", "/app/config.json"]