diff --git a/Dockerfile b/Dockerfile index 7ec1da0..6770b3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:latest +# Builder stage +FROM alpine:latest as builder -# Update and install necessary packages RUN apk update && \ - apk add p7zip rclone + apk add --no-cache p7zip rclone # Create config directory RUN mkdir -p /root/.config/rclone/ @@ -11,6 +11,15 @@ RUN mkdir -p /root/.config/rclone/ COPY rclone.conf /root/.config/rclone/rclone.conf COPY app/ /app/ +# Final stage +FROM alpine:latest + +# Copy necessary binaries and files from builder stage +COPY --from=builder /usr/bin/rclone /usr/bin/rclone +COPY --from=builder /usr/bin/7z /usr/bin/7z +COPY --from=builder /root/.config/rclone/rclone.conf /root/.config/rclone/rclone.conf +COPY --from=builder /app/ /app/ + WORKDIR /app -ENTRYPOINT /app/zip2cloud \ No newline at end of file +ENTRYPOINT ["/app/zip2cloud"] \ No newline at end of file diff --git a/app/zip2cloud b/app/zip2cloud index 5ce5fc2..e7fe87b 100755 --- a/app/zip2cloud +++ b/app/zip2cloud @@ -62,4 +62,4 @@ done ## Create a block that, upon success of rclone above, delete _only_ files that were uploaded ## For each $FILE.7z in $ZIP_DIR, do a "rm -rf $DUMP_BASE/$FILE" to remove the original dump -#[ -z "${DELETE_DUMP}" ] || { echo "Clearing contents of /dump/"; cd /dump/; rm -rf *; } +#[ -z "${DELETE_DUMP}" ] || { echo "Clearing contents of /dump/"; cd /dump/; rm -rf *; } \ No newline at end of file