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 b0520cc
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 423 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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem "govuk_feature_flags",
git: "https://github.com/DFE-Digital/govuk_feature_flags.git",
tag: "v1.0.1"
gem "govuk_markdown"
gem "grover"
gem 'grover', '1.1.9'
gem "hashie"
gem "jsbundling-rails"
gem "jwt"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ GEM
cgi (0.4.1)
childprocess (5.0.0)
coderay (1.1.3)
combine_pdf (1.0.26)
combine_pdf (1.0.28)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.3.4)
Expand Down Expand Up @@ -254,7 +254,7 @@ GEM
govuk_markdown (2.0.2)
activesupport
redcarpet
grover (1.1.7)
grover (1.1.9)
combine_pdf (~> 1.0)
nokogiri (~> 1.0)
haml (6.1.1)
Expand Down Expand Up @@ -681,7 +681,7 @@ DEPENDENCIES
govuk_design_system_formbuilder (~> 5.6)
govuk_feature_flags!
govuk_markdown
grover
grover (= 1.1.9)
hashie
jsbundling-rails
jwt
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"esbuild": "^0.24.0",
"govuk-frontend": "^5.6.0",
"sass": "^1.79.3",
"puppeteer": "22.6.1"
"puppeteer": "23.8.0"
},
"scripts": {
"build:css": "sass ./app/assets/stylesheets/certificates.scss:./app/assets/builds/certificates.css ./app/assets/stylesheets/check_records.scss:./app/assets/builds/check_records.css ./app/assets/stylesheets/qualifications.scss:./app/assets/builds/qualifications.css --no-source-map --load-path=node_modules --quiet-deps",
Expand Down
Loading

0 comments on commit b0520cc

Please sign in to comment.