delete converted file

This commit is contained in:
Jay 2019-05-16 09:33:33 +08:00
parent 1275619fa0
commit 0661527a9c
2 changed files with 17 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM golang:1.12-alpine as builder
WORKDIR /data
COPY . .
RUN apk add --no-cache make git ca-certificates && \
make
FROM alpine:latest
RUN apk add --no-cache ca-certificates
WORKDIR /data
COPY --from=builder /data/convert-webp /usr/bin
COPY config.default.yml config.yml
EXPOSE 10230
VOLUME ["/img-src", "/img-dist"]
CMD ["/usr/bin/convert-webp", "-f", "/data/config.yml"]

View File

@ -89,6 +89,9 @@ func procFile(loc string) {
return
}
go func(loc string) {
defer func() {
os.Remove(loc)
}()
fin := waitFile(loc)
if fin {
log.Println("file write ok")