Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docker image building #630

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
ruby-version: 3.2.2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
node-version: '16'
- run: npm install -g yarn
- uses: nanasess/setup-chromedriver@master
- name: Build and run tests
Expand Down
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,28 @@ FROM cimg/ruby:${RUBY_VERSION}-node
ENV HOME=/app
WORKDIR /app


# ENV SSL_CERT_DIR=/etc/ssl/certs
# ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

# Install NodeJS
RUN sudo apt-get update
# RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
# RUN sudo apt-get install -y nodejs
# RUN npm install yarn -g

ENV CURL_CONNECT_TIMEOUT=0 CURL_TIMEOUT=0 GEM_PATH="$HOME/vendor/bundle/ruby/${RUBY_VERSION}:$GEM_PATH" LANG=${LANG:-en_US.UTF-8} PATH="$HOME/bin:$HOME/vendor/bundle/bin:$HOME/vendor/bundle/ruby/${RUBY_VERSION}/bin:$PATH" RACK_ENV=${RACK_ENV:-production} RAILS_ENV=${RAILS_ENV:-production} RAILS_SERVE_STATIC_FILES=${RAILS_SERVE_STATIC_FILES:-enabled} SECRET_KEY_BASE=${SECRET_KEY_BASE:-PLACEHOLDERSECRETBASEKEY}

# Cache bundler
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock

# circleci-image specific
RUN sudo chown circleci:circleci /app/Gemfile.lock

RUN bundle config set --local path 'vendor/bundle'
RUN bundle config set --local without 'development test'
RUN bundle install --jobs 4 --retry 3

COPY . /app

# circleci-image specific
RUN sudo chown -R circleci:circleci /app
RUN sudo chown -R circleci:circleci /tmp

RUN yarn install
RUN RAILS_ENV=production NODE_ENV=production DATABASE_URL=postgresql://localhost/dummy_url bundle exec rake assets:precompile
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gem 'jquery-ui-rails', '6.0.1'
gem 'bootstrap-sass', '~> 3.4'
gem 'govuk_frontend_toolkit', '~> 3.1.0'
gem 'govuk_template', '0.12.0'
gem 'uglifier', '>= 2.7.2'
gem "terser", "~> 1.1"
gem 'js_cookie_rails', '2.1.4'
gem 'ckeditor'
gem 'webpacker'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,8 @@ GEM
statesman (11.0.0)
stringio (3.0.9)
temple (0.8.2)
terser (1.1.20)
execjs (>= 0.3.0, < 3)
thor (1.3.0)
thread_safe (0.3.6)
tilt (2.0.11)
Expand All @@ -712,8 +714,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.8.0)
unicode_utils (1.4.0)
vigilion-rails (2.1.0)
Expand Down Expand Up @@ -845,9 +845,9 @@ DEPENDENCIES
sprockets (~> 3.7.2)
sprockets-rails (>= 2.0.0)
statesman (~> 11.0)
terser (~> 1.1)
timecop
turnip (~> 4.4.0)
uglifier (>= 2.7.2)
vigilion (~> 1.0.4)!
vigilion-rails (~> 2.1.0)
virtus
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'uglifier'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down Expand Up @@ -29,7 +28,8 @@
}

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(compress: { unused: false })
config.assets.js_compressor = :terser


# config.assets.css_compressor = :sass

Expand Down
Loading
Loading