Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpattinson committed Nov 20, 2024
1 parent 3704790 commit 42ab711
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 347 deletions.
23 changes: 15 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ RUN bundler -v && \
bundle config set no-binstubs 'true' && \
bundle config set without 'development test' && \
bundle install --retry=5 --jobs=4 && \
rm -rf /usr/local/bundle/cache
rm -rf /usr/local/bundle/cache \

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_DOWNLOAD=true

# Install node packages defined in package.json
COPY package.json yarn.lock ./
Expand All @@ -53,13 +56,13 @@ RUN DATABASE_PASSWORD=required-to-run-but-not-used \
bundle exec rails assets:precompile

# Cleanup to save space in the production image
RUN rm -rf node_modules log/* tmp/* /tmp && \
rm -rf /usr/local/bundle/cache && \
rm -rf .env && \
find /usr/local/bundle/gems -name "*.c" -delete && \
find /usr/local/bundle/gems -name "*.h" -delete && \
find /usr/local/bundle/gems -name "*.o" -delete && \
find /usr/local/bundle/gems -name "*.html" -delete
#RUN rm -rf node_modules log/* tmp/* /tmp && \
# rm -rf /usr/local/bundle/cache && \
# rm -rf .env && \
# find /usr/local/bundle/gems -name "*.c" -delete && \
# find /usr/local/bundle/gems -name "*.h" -delete && \
# find /usr/local/bundle/gems -name "*.o" -delete && \
# find /usr/local/bundle/gems -name "*.html" -delete

# Build runtime image
FROM ruby:3.3.0-alpine as production
Expand All @@ -82,6 +85,10 @@ RUN apk add --update --no-cache tzdata && \
# libpq: required to run postgres
RUN apk add --no-cache libpq

# install chromium and node for the PDF generation
RUN apk add --no-cache nodejs
RUN apk add --no-cache chromium

# Copy files generated in the builder image
COPY --from=builder /app /app
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
Expand Down
Loading

0 comments on commit 42ab711

Please sign in to comment.