2020-08-18 05:30:26 +08:00
|
|
|
# GENERATED FILE, DO NOT MODIFY!
|
|
|
|
# To update this file please edit the relevant template and run the generation
|
2020-08-11 22:53:05 +08:00
|
|
|
# task `build/dockerfile_writer.rb --env jenkins --compose-file docker-compose.yml,docker-compose.override.yml --in build/Dockerfile.template --out Dockerfile.jenkins`
|
2020-08-18 05:30:26 +08:00
|
|
|
|
2023-05-19 03:13:45 +08:00
|
|
|
ARG RUBY=3.1
|
2020-08-18 05:30:26 +08:00
|
|
|
|
2021-01-07 00:19:06 +08:00
|
|
|
FROM starlord.inscloudgate.net/jenkins/ruby-passenger:$RUBY
|
2020-08-18 05:30:26 +08:00
|
|
|
LABEL maintainer="Instructure"
|
|
|
|
|
2023-03-23 21:11:02 +08:00
|
|
|
ARG RUBY
|
2022-08-26 03:00:44 +08:00
|
|
|
ARG POSTGRES_CLIENT=14
|
2020-08-18 05:30:26 +08:00
|
|
|
ENV APP_HOME /usr/src/app/
|
|
|
|
ENV RAILS_ENV production
|
rework handlebars dependency on brandable_css
refs FOO-1116
right now in order to build the javascript, we must run brandable_css
first for the specific purpose of injecting into handlebars templates
their corresponding stylesheet file with the checksum as reported by
brandable_css
this patch moves things around such that Rails provides this mapping of
"handlebars template" to "CSS variant file checksums" in a global
variable (Rails is privy to this information already), webpack then at
build time injects only a reference to that mapping into the template,
then our runtime brandable-css JS helper will resolve that reference
from the mapping and request the correct file based on the current
user's variant
[1] rails assigns window.BRANDABLE_CSS_HANDLEBARS_INDEX with content
like this:
[
[ "new_styles_normal_contrast", "new_styles_high_contrast", ... ],
{
"0c": ["0f4f01ab86", 0, 0, "e3e7211701", 3, ... ],
...
}
]
the structure of the mapping is explained in brandable_css[1], it is
a bit overtuned to reduce the size as much as possible since this is
included for ALL pages even though the templates in question may never
be rendered (right now it's ~1.5kB and should never grow)
[2] webpack asks @canvas/brandable-css to loadStylesheetForJST using the
contrived id for that file (frontend_build/i18nLinerHandlebars.js:92)
[3] brandable-css/index.js will decode that structure to arrive at the
exact URL for the stylesheet for that template for the current user
variant
with this , we should be able to optimize "rake canvas:compile_assets"
to run both brandable_css and webpack in parallel, which will greatly
mitigate the performance decrease from moving from node-sass to
dart-sass
== test plan
go to some assignment's syllabus page, edit the file
app/stylesheets/jst/courses/Syllabus.scss with something fun like:
#syllabus .day_date { background: $fire; }
rerun `npx brandable_css`, reload the page and verify it's on fire,
optionally change your setting to enable High Contrast mode, reload
the syllabus page and verify the color changes (it picks up the other
variant stylesheet)
[1]: https://github.com/instructure/brandable_css/pull/4/commits/80af6e70af6ad60312187f256c2457d33ca75202
Change-Id: Ie48cc71d4837ee02313b2d45a9ad2944725acad2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268615
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-07-08 08:03:09 +08:00
|
|
|
ENV SASS_STYLE compressed
|
2020-09-10 07:44:21 +08:00
|
|
|
ENV NGINX_MAX_UPLOAD_SIZE 10g
|
2020-08-18 05:30:26 +08:00
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LANGUAGE en_US.UTF-8
|
|
|
|
ENV LC_CTYPE en_US.UTF-8
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
2024-06-25 01:37:19 +08:00
|
|
|
ARG CANVAS_RAILS=7.1
|
2022-03-24 04:16:20 +08:00
|
|
|
ENV CANVAS_RAILS=${CANVAS_RAILS}
|
2020-08-18 05:30:26 +08:00
|
|
|
|
2023-09-07 02:05:02 +08:00
|
|
|
ENV NODE_MAJOR 18
|
2020-09-10 07:44:21 +08:00
|
|
|
ENV YARN_VERSION 1.19.1-1
|
|
|
|
ENV GEM_HOME /home/docker/.gem/$RUBY
|
2023-05-23 02:23:36 +08:00
|
|
|
ENV PATH ${APP_HOME}bin:$GEM_HOME/bin:$PATH
|
2020-08-18 05:30:26 +08:00
|
|
|
ENV BUNDLE_APP_CONFIG /home/docker/.bundle
|
|
|
|
|
2020-10-09 02:50:27 +08:00
|
|
|
WORKDIR $APP_HOME
|
|
|
|
|
2020-08-18 05:30:26 +08:00
|
|
|
USER root
|
2023-08-30 22:45:19 +08:00
|
|
|
RUN mkdir -p /etc/apt/keyrings \
|
|
|
|
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
|
|
|
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
2020-09-10 07:44:21 +08:00
|
|
|
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
|
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
|
|
|
&& printf 'path-exclude /usr/share/doc/*\npath-exclude /usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/01_nodoc \
|
|
|
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
|
|
|
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
2023-11-16 02:49:03 +08:00
|
|
|
&& add-apt-repository ppa:git-core/ppa -ny \
|
2020-09-10 07:44:21 +08:00
|
|
|
&& apt-get update -qq \
|
|
|
|
&& apt-get install -qqy --no-install-recommends \
|
|
|
|
nodejs \
|
|
|
|
yarn="$YARN_VERSION" \
|
|
|
|
libxmlsec1-dev \
|
2022-01-14 06:11:01 +08:00
|
|
|
python3-lxml \
|
2022-07-01 23:13:30 +08:00
|
|
|
python-is-python3 \
|
2020-09-10 07:44:21 +08:00
|
|
|
libicu-dev \
|
2022-08-18 23:44:07 +08:00
|
|
|
libidn11-dev \
|
2020-09-10 07:44:21 +08:00
|
|
|
parallel \
|
|
|
|
postgresql-client-$POSTGRES_CLIENT \
|
|
|
|
unzip \
|
|
|
|
pbzip2 \
|
2022-07-02 00:27:03 +08:00
|
|
|
\
|
2021-06-12 00:42:24 +08:00
|
|
|
git \
|
|
|
|
build-essential \
|
2020-09-10 07:44:21 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0
|
2021-04-06 04:46:04 +08:00
|
|
|
|
2024-06-05 07:33:51 +08:00
|
|
|
RUN gem install bundler --no-document -v 2.5.10 \
|
2020-09-10 07:44:21 +08:00
|
|
|
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
|
2023-09-01 22:55:36 +08:00
|
|
|
RUN npm install -g npm@9.8.1 && npm cache clean --force
|
2020-08-18 05:30:26 +08:00
|
|
|
|
|
|
|
USER docker
|