diff --git a/Dockerfile b/Dockerfile index b5cae9d..73db8c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,34 @@ -FROM ruby:3.4.3-alpine +FROM ruby:3.4.4-alpine AS builder USER root + +RUN apk add --no-cache \ + build-base \ + ruby-dev \ + libffi-dev \ + yaml-dev + WORKDIR /build -COPY Gemfile /build/ -COPY *.gemspec /build/ +COPY Gemfile Gemfile.lock ./ +COPY *.gemspec ./ -RUN gem update \ - && bundle config set jobs $(nproc) \ - && bundle install +RUN gem update --system && \ + bundle config set jobs $(nproc) && \ + bundle install --jobs=$(nproc) --retry=3 --without development test -COPY . /build +COPY . . + +FROM ruby:3.4.3-alpine +USER root + +RUN apk add --no-cache \ + libffi \ + yaml + +WORKDIR /app + +COPY --from=builder /usr/local/bundle /usr/local/bundle +COPY --from=builder /build /app WORKDIR / -ENTRYPOINT [ "/build/bin/wayback_machine_downloader" ] \ No newline at end of file +ENTRYPOINT [ "/app/bin/wayback_machine_downloader" ] \ No newline at end of file