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

Upgrade to Rails 7 and latest JS/CSS Tooling #2290

Merged
merged 17 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix production docker build
  • Loading branch information
ErikSchierboom committed Feb 2, 2022
commit c85f37adf4fdd2b0549790f33a9f181bd8a2f940
29 changes: 10 additions & 19 deletions docker/rails.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
FROM ruby:3.1.0-bullseye

# Set global env variables
ENV RAILS_ENV=development
ErikSchierboom marked this conversation as resolved.
Show resolved Hide resolved
ENV NODE_ENV=production
ENV NODE_OPTIONS="--max-old-space-size=6144"

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y cmake make nodejs yarn graphicsmagick

WORKDIR /opt/exercism/website

# Set this as a global env var
ENV RAILS_ENV=production

# Only Gemfile and Gemfile.lock changes require a new bundle install
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && \
bundle config set deployment 'true' && \
bundle config set without 'development test' && \
bundle install

# Only package.json and yarn.lock require a new yarn install
# Only package.json and yarn.lock changes require a new yarn install
COPY package.json yarn.lock ./
RUN yarn install

# Copy any files that might require an asset compilation changing.
# These are:
# - Anything in the apex (such as babel.config.js); and
# - The bin directory that contains the requisit scripts
# - The contents on app/javascript
# These are deliberately permissive in case we want to add
# future apex files or future config files, so we don't have
# to worry about adding them here.
# Copy everything over now
COPY . ./

# This compiles the assets into public/packs
# This compiles the assets
# During deployment the assets are copied from this image and
# uploaded into s3. The assets left on the machine are not actually
# used leave the assets on here.
ENV NODE_OPTIONS="--max-old-space-size=6144"

# Copy everything over now
COPY . ./

RUN NODE_ENV=production bundle exec rails assets:precompile
RUN bundle exec rails assets:precompile

ENTRYPOINT bin/start_webserver
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@
"@stripe/react-stripe-js": "1.4.1",
"@stripe/stripe-js": "^1.15.1",
"@tippyjs/react": "^4.2.5",
"@types/actioncable": "^5.2.3",
"@types/humps": "^2.0.0",
"@types/normalize-url": "^4.2.0",
"@xstate/react": "^1.3.1",
"abortcontroller-polyfill": "^1.7.3",
"ace-builds": "^1.4.12",
"actioncable": "^5.2.4-3",
"autoprefixer": "^10.4.0",
"babel-plugin-macros": "^3.1.0",
"browserslist-to-esbuild": "^1.1.1",
"chart.js": "^3.1.0",
"codemirror-lang-elixir": "https://github.com/sachinraja/codemirror-lang-elixir",
Expand All @@ -49,7 +44,6 @@
"diff2html": "^3.4.5",
"easymde": "^2.15.0",
"esbuild": "^0.14.5",
"esbuild-jest": "^0.5.0",
"esbuild-plugin-import-glob": "^0.1.1",
"focus-visible": "^5.2.0",
"fontfaceobserver": "^2.1.0",
Expand Down Expand Up @@ -99,26 +93,32 @@
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/react": "^10.4.3",
"@testing-library/user-event": "^12.6.0",
"@types/actioncable": "^5.2.3",
"@types/fontfaceobserver": "^0.0.6",
"@types/humps": "^2.0.0",
"@types/jquery": "^3.5.5",
"@types/lodash": "^4.14.165",
"@types/mousetrap": "^1.6.8",
"@types/normalize-url": "^4.2.0",
"@types/pluralize": "^0.0.29",
"@types/qs": "^6.9.5",
"@types/react": "^16.9.51",
"@types/react-dom": "^16.9.8",
"@types/react-image-crop": "^8.1.2",
"@types/react-modal": "^3.12.0",
"@types/react": "^16.9.51",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"autoprefixer": "^10.4.0",
"babel-jest": "^26.5.0",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"esbuild-jest": "^0.5.0",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-react": "^7.21.3",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-react": "^7.21.3",
"eslint-plugin-testing-library": "^4.1.2",
"flush-promises": "^1.0.2",
"husky": "^4.2.5",
Expand Down
Loading