forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (59 loc) · 2.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# See doc/docker/README.md or https://github.com/instructure/canvas-lms/tree/master/doc/docker
FROM instructure/ruby-passenger:2.4
ENV APP_HOME /usr/src/app/
ENV RAILS_ENV "production"
ENV NGINX_MAX_UPLOAD_SIZE 10g
USER root
WORKDIR /root
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -\
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -\
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update -qq \
&& apt-get install -qqy \
nodejs \
yarn \
postgresql-client \
libxmlsec1-dev \
unzip \
fontforge \
python-lxml \
libicu-dev \
&& yarn global add gulp \
&& rm -rf /var/lib/apt/lists/*\
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0
# We will need sfnt2woff in order to build fonts
RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="-i /var/lib/gems/$RUBY_MAJOR.0"; fi \
&& curl -O https://people-mozilla.org/~jkew/woff/woff-code-latest.zip \
&& unzip woff-code-latest.zip \
&& make \
&& cp sfnt2woff /usr/local/bin \
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v 1.14.3 \
&& gem update --system --no-document \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
WORKDIR $APP_HOME
USER root
COPY Gemfile ${APP_HOME}
COPY Gemfile.d ${APP_HOME}Gemfile.d
COPY config ${APP_HOME}config
COPY gems ${APP_HOME}gems
COPY script ${APP_HOME}script
COPY package.json ${APP_HOME}
RUN chown -R docker:docker ${APP_HOME} /home/docker
# Install deps as docker to avoid sadness w/ npm lifecycle hooks
USER docker
RUN bundle install --jobs 8 \
&& yarn install
USER root
COPY . $APP_HOME
RUN mkdir -p log \
tmp \
public/javascripts/client_apps \
public/javascripts/compiled \
public/dist \
public/assets \
client_apps/canvas_quizzes/node_modules \
/home/docker/.cache/yarn/.tmp \
&& chown -R docker:docker ${APP_HOME} /home/docker
USER docker
RUN bundle exec rake canvas:compile_assets